Skip to content

Commit 428d63d

Browse files
committed
Fix memleak
1 parent c5da068 commit 428d63d

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/appimagetool.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -562,7 +562,9 @@ main (int argc, char *argv[])
562562
gchar* version_env = getenv("VERSION");
563563

564564
if (guess_update_information) {
565-
if (g_find_program_in_path("git")) {
565+
char* gitPath = g_find_program_in_path("git");
566+
567+
if (gitPath != NULL) {
566568
if (version_env == NULL) {
567569
GError* error = NULL;
568570
gchar* out = NULL;
@@ -602,6 +604,8 @@ main (int argc, char *argv[])
602604
}
603605
}
604606
}
607+
608+
free(gitPath);
605609
}
606610

607611
if(!((0 == strcmp(sqfs_comp, "gzip")) || (0 ==strcmp(sqfs_comp, "xz"))))

0 commit comments

Comments
 (0)