mirror of
https://github.com/libguestfs/libguestfs.git
synced 2026-03-21 22:53:37 +00:00
daemon: Ensure CLEANUP_FREE* variables are initialized with NULL.
Otherwise an early exit from the function will cause an uninitialized
pointer to be freed.
This fixes commit 1d7c3a2782.
This commit is contained in:
@@ -249,7 +249,7 @@ cleanup_free_mountable (mountable_t *mountable)
|
||||
List.iter (
|
||||
function
|
||||
| Device n | Dev_or_Path n ->
|
||||
pr " CLEANUP_FREE char *%s;\n" n
|
||||
pr " CLEANUP_FREE char *%s = NULL;\n" n
|
||||
| Pathname n | String n | Key n | OptString n ->
|
||||
pr " const char *%s;\n" n
|
||||
| Mountable n | Mountable_or_Path n ->
|
||||
@@ -258,7 +258,7 @@ cleanup_free_mountable (mountable_t *mountable)
|
||||
| StringList n ->
|
||||
pr " char **%s;\n" n
|
||||
| DeviceList n ->
|
||||
pr " CLEANUP_FREE_STRING_LIST char **%s;\n" n
|
||||
pr " CLEANUP_FREE_STRING_LIST char **%s = NULL;\n" n
|
||||
| Bool n -> pr " int %s;\n" n
|
||||
| Int n -> pr " int %s;\n" n
|
||||
| Int64 n -> pr " int64_t %s;\n" n
|
||||
|
||||
Reference in New Issue
Block a user