diff options
| author | Paolo Bonzini <pbonzini@redhat.com> | 2012-12-06 19:50:34 +0100 |
|---|---|---|
| committer | Paolo Bonzini <pbonzini@redhat.com> | 2012-12-07 10:45:51 +0100 |
| commit | f823d2efc5c6b96a109b985684ef7d85c3045e6b (patch) | |
| tree | fbf9ef242dc5ecd5645d55916539c82c0f06186e /tools | |
| parent | d4b3a4fcc4f74b35e145844ef4982372cb459764 (diff) | |
msiinfo: use g_malloc
Diffstat (limited to 'tools')
| -rw-r--r-- | tools/msiinfo.c | 8 |
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); |
