summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRichard W.M. Jones <rjones@redhat.com>2011-04-12 18:05:35 +0100
committerRichard W.M. Jones <rjones@redhat.com>2011-04-12 18:05:35 +0100
commit88ff38dab607f7218756ce87e014c0e699e162f8 (patch)
treec9383f65bc5a4deec443d5c279e3257ad3e7a7f7
parent11374abeadfb01252bdb02c0915d1edc79512e79 (diff)
downloadlibguestfs-88ff38dab607f7218756ce87e014c0e699e162f8.tar.gz
libguestfs-88ff38dab607f7218756ce87e014c0e699e162f8.tar.xz
libguestfs-88ff38dab607f7218756ce87e014c0e699e162f8.zip
inspect: Fix some small memory leaks in Windows inspection.
Found using valgrind.
-rw-r--r--src/inspect.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/inspect.c b/src/inspect.c
index be98b0dd..16baf0b2 100644
--- a/src/inspect.c
+++ b/src/inspect.c
@@ -1689,6 +1689,7 @@ check_windows_system_registry (guestfs_h *g, struct inspect_fs *fs)
if (STRCASEEQLEN (key, "\\DosDevices\\", 12) &&
c_isalpha (key[12]) && key[13] == ':')
count++;
+ free (key);
}
fs->drive_mappings = calloc (2*count + 1, sizeof (char *));
@@ -1721,6 +1722,7 @@ check_windows_system_registry (guestfs_h *g, struct inspect_fs *fs)
}
free (blob);
}
+ free (key);
}
/* Get the hostname. */
@@ -1738,6 +1740,7 @@ check_windows_system_registry (guestfs_h *g, struct inspect_fs *fs)
goto out;
}
+ free (values);
values = hivex_node_values (h, node);
for (i = 0; values[i] != 0; ++i) {