summaryrefslogtreecommitdiff
path: root/src/java-utils.c
diff options
context:
space:
mode:
authorPavel Shlyak <[email protected]>2020-07-12 10:58:34 +0300
committerZenWalker <[email protected]>2020-07-31 23:53:11 +0200
commit230d984bd4945ab561469d8145116a7f75f3c784 (patch)
treefe89ea1ae629f6896932445acfff0ca154b3e579 /src/java-utils.c
parentd75c80047df558a76c7d276adbedf24e337f1650 (diff)
downloadengrampa-230d984bd4945ab561469d8145116a7f75f3c784.tar.bz2
engrampa-230d984bd4945ab561469d8145116a7f75f3c784.tar.xz
Avoid memory leak in java utils
Diffstat (limited to 'src/java-utils.c')
-rw-r--r--src/java-utils.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/java-utils.c b/src/java-utils.c
index 1efcb3f..7fa0ff3 100644
--- a/src/java-utils.c
+++ b/src/java-utils.c
@@ -309,7 +309,9 @@ get_package_name_from_class_file (char *fname)
for (j = length; (j >= 0) && (end == 0); j--)
if (package[j] == '/')
end = j;
- package = g_strndup (package, end);
+ char *package_padded = g_strndup (package, end);
+ g_free(package);
+ package = package_padded;
}
java_class_file_free (cfile);