summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPaolo Bonzini <pbonzini@redhat.com>2012-12-06 19:50:34 +0100
committerPaolo Bonzini <pbonzini@redhat.com>2012-12-07 10:45:51 +0100
commitf823d2efc5c6b96a109b985684ef7d85c3045e6b (patch)
treefbf9ef242dc5ecd5645d55916539c82c0f06186e
parentd4b3a4fcc4f74b35e145844ef4982372cb459764 (diff)
downloadmsitools-f823d2efc5c6b96a109b985684ef7d85c3045e6b.tar.gz
msitools-f823d2efc5c6b96a109b985684ef7d85c3045e6b.tar.xz
msitools-f823d2efc5c6b96a109b985684ef7d85c3045e6b.zip
msiinfo: use g_malloc
-rw-r--r--tools/msiinfo.c8
1 files changed, 2 insertions, 6 deletions
diff --git a/tools/msiinfo.c b/tools/msiinfo.c
index 0aa04bd..1d96ea5 100644
--- a/tools/msiinfo.c
+++ b/tools/msiinfo.c
@@ -275,7 +275,7 @@ static void print_suminfo(LibmsiSummaryInfo *si, int prop, const char *name)
break;
case LIBMSI_PROPERTY_TYPE_STRING:
- buf = malloc(++sz);
+ buf = g_malloc(++sz);
r = libmsi_summary_info_get_property(si, prop, NULL, NULL, NULL, buf, &sz);
if (r) {
print_libmsi_error(r);
@@ -396,11 +396,7 @@ static int cmd_extract(struct Command *cmd, int argc, char **argv)
}
bufsize = (size > 1048576 ? 1048576 : size);
- buf = malloc(bufsize);
- if (!buf) {
- perror("malloc");
- exit(1);
- }
+ buf = g_malloc(bufsize);
#if O_BINARY
_setmode(STDOUT_FILENO, O_BINARY);