diff options
author | Joseph Hunkeler <jhunkeler@gmail.com> | 2020-01-30 09:03:11 -0500 |
---|---|---|
committer | Joseph Hunkeler <jhunkeler@gmail.com> | 2020-01-30 09:03:11 -0500 |
commit | a208097c9091137908beaa1f1f261072df55d3fa (patch) | |
tree | 8818bfa6c19c4a43b7bb19431a442d3bdfa9a80e /src/internal_cmd.c | |
parent | 7c2b1baad8434f9f7b19efe48719942cb3bce4cd (diff) | |
download | spmc-a208097c9091137908beaa1f1f261072df55d3fa.tar.gz |
SEAD - memory leaks
Diffstat (limited to 'src/internal_cmd.c')
-rw-r--r-- | src/internal_cmd.c | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/src/internal_cmd.c b/src/internal_cmd.c index bcd0231..17d49af 100644 --- a/src/internal_cmd.c +++ b/src/internal_cmd.c @@ -101,6 +101,7 @@ int mkmanifest_interface(int argc, char **argv) { return -1; } Manifest *manifest = NULL; + int result = 0; char *pkgdir = NULL; char path[PATH_MAX]; memset(path, '\0', PATH_MAX); @@ -128,7 +129,14 @@ int mkmanifest_interface(int argc, char **argv) { return -2; } - return manifest_write(manifest, path); + result = manifest_write(manifest, path); + if (result != 0) { + manifest_free(manifest); + return -3; + } + + manifest_free(manifest); + return result; } /** @@ -219,7 +227,7 @@ int rpath_autoset_interface(int argc, char **argv) { */ void internal_command_list(void) { printf("possible commands:\n"); - for (int i = 0; internal_commands[i] != NULL; i++) { + for (size_t i = 0; internal_commands[i] != NULL; i++) { // TODO: fix double increment warning (i++ becomes i+2?) printf(" %-20s - %-20s\n", internal_commands[i], internal_commands[i + 1]); i++; } |