diff options
author | kaotisk <kaotisk@arching-kaos.org> | 2025-04-29 06:42:35 +0300 |
---|---|---|
committer | kaotisk <kaotisk@arching-kaos.org> | 2025-04-29 19:31:29 +0300 |
commit | 8f64ff6e5ce8bd349819f8fd499fc741a2ac1926 (patch) | |
tree | 20138add5ee35c77e4370a042c78244e160a1672 /c_implementation/src/ak_fs_map_v3.c | |
parent | 1d10339904b31f58d7461c0b806f842609571d92 (diff) | |
download | arching-kaos-tools-8f64ff6e5ce8bd349819f8fd499fc741a2ac1926.tar.gz arching-kaos-tools-8f64ff6e5ce8bd349819f8fd499fc741a2ac1926.tar.bz2 arching-kaos-tools-8f64ff6e5ce8bd349819f8fd499fc741a2ac1926.zip |
Reducing leaks
Diffstat (limited to 'c_implementation/src/ak_fs_map_v3.c')
-rw-r--r-- | c_implementation/src/ak_fs_map_v3.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/c_implementation/src/ak_fs_map_v3.c b/c_implementation/src/ak_fs_map_v3.c index 6774f65..1d3e37e 100644 --- a/c_implementation/src/ak_fs_map_v3.c +++ b/c_implementation/src/ak_fs_map_v3.c @@ -1,5 +1,6 @@ #include <stdio.h> #include <string.h> +#include <stdlib.h> #include <libakfs.h> #include <libaklog.h> #include <sys/stat.h> @@ -179,12 +180,14 @@ int ak_fs_map_v3_open_from_file(akfs_map_v3 * map) { // perror("fopen"); ak_log_debug(__func__, "File not found or other error"); + free(full_path); return 1; } struct stat sb; if (stat(full_path, &sb) == -1) { perror("stat"); fclose(fd); + free(full_path); return 2; } // File size: %lld in bytes: (long long) sb.st_size); @@ -195,9 +198,11 @@ int ak_fs_map_v3_open_from_file(akfs_map_v3 * map) { ak_log_debug(__func__,"conversion failed"); fclose(fd); + free(full_path); return 1; } fclose(fd); + free(full_path); return 0; } |