summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorPavel Shlyak <[email protected]>2020-07-12 10:58:34 +0300
committerPablo Barciela <[email protected]>2020-07-31 23:52:51 +0200
commita02e15e87391449a7a9d025fe7593339d8a3ba41 (patch)
tree821c1bfac10612ee6063a5f1a6257e01934b9a93 /src
parent6c4f1443c8f12227cb38ef7592c26c1d95d7a499 (diff)
downloadengrampa-a02e15e87391449a7a9d025fe7593339d8a3ba41.tar.bz2
engrampa-a02e15e87391449a7a9d025fe7593339d8a3ba41.tar.xz
Avoid memory leak in java utils
Diffstat (limited to 'src')
-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);