Skip to content

Commit f823d2e

Browse files
committed
msiinfo: use g_malloc
1 parent d4b3a4f commit f823d2e

File tree

1 file changed

+2
-6
lines changed

1 file changed

+2
-6
lines changed

tools/msiinfo.c

+2-6
Original file line numberDiff line numberDiff line change
@@ -275,7 +275,7 @@ static void print_suminfo(LibmsiSummaryInfo *si, int prop, const char *name)
275275
break;
276276

277277
case LIBMSI_PROPERTY_TYPE_STRING:
278-
buf = malloc(++sz);
278+
buf = g_malloc(++sz);
279279
r = libmsi_summary_info_get_property(si, prop, NULL, NULL, NULL, buf, &sz);
280280
if (r) {
281281
print_libmsi_error(r);
@@ -396,11 +396,7 @@ static int cmd_extract(struct Command *cmd, int argc, char **argv)
396396
}
397397

398398
bufsize = (size > 1048576 ? 1048576 : size);
399-
buf = malloc(bufsize);
400-
if (!buf) {
401-
perror("malloc");
402-
exit(1);
403-
}
399+
buf = g_malloc(bufsize);
404400

405401
#if O_BINARY
406402
_setmode(STDOUT_FILENO, O_BINARY);

0 commit comments

Comments
 (0)