diff options
author | Pavel Shlyak <[email protected]> | 2020-07-12 10:58:34 +0300 |
---|---|---|
committer | ZenWalker <[email protected]> | 2020-07-31 23:53:11 +0200 |
commit | 230d984bd4945ab561469d8145116a7f75f3c784 (patch) | |
tree | fe89ea1ae629f6896932445acfff0ca154b3e579 /src | |
parent | d75c80047df558a76c7d276adbedf24e337f1650 (diff) | |
download | engrampa-230d984bd4945ab561469d8145116a7f75f3c784.tar.bz2 engrampa-230d984bd4945ab561469d8145116a7f75f3c784.tar.xz |
Avoid memory leak in java utils
Diffstat (limited to 'src')
-rw-r--r-- | src/java-utils.c | 4 |
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); |