aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorChristian C <cc@localhost>2025-04-02 18:15:13 -0700
committerChristian C <cc@localhost>2025-04-02 18:15:13 -0700
commit00ce37145556279f4982ef52a747cb2f5e3e3081 (patch)
treeaeee1e555d11bed381f1fdb34f3d95ba1aa05ea8 /src
parentec7436a01deb8e28743de47ad98950c914d6da2a (diff)
Fixed Memory Leak
Diffstat (limited to 'src')
-rw-r--r--src/prog.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/prog.c b/src/prog.c
index e08bb72..6999a32 100644
--- a/src/prog.c
+++ b/src/prog.c
@@ -97,6 +97,7 @@ int main(int arg_count, char **arg_value) {
for (size_t index = 0; file_list[index] != NULL; index++) {
char *fname = file_list[index];
if (is_tif_ext(fname) == FALSE) {
+ fprintf(stderr, "Allocation error?\n");
g_free(file_list[index]);
continue;
}
@@ -107,6 +108,7 @@ int main(int arg_count, char **arg_value) {
// 4. Free up allocations made in this process
char *fpath = full_path(process_directory, fname);
if (fpath == NULL) {
+ fprintf(stderr, "Allocation error?\n");
g_free(file_list[index]);
continue;
}
@@ -118,6 +120,7 @@ int main(int arg_count, char **arg_value) {
//-----------------------------------------------
Mask *file_im = tif_to_labels(fpath, &starting_label);
if (file_im == NULL) {
+ fprintf(stderr, "Allocation error?\n");
g_free(fpath);
g_free(file_list[index]);
continue;
@@ -206,6 +209,7 @@ int main(int arg_count, char **arg_value) {
Bitmap *bitmap = image_mask_data_to_bitmap(masks_im);
if (bitmap != NULL) {
save_png(bitmap, png_output_file_fullpath);
+ g_free(bitmap->image_buffer);
g_free(bitmap);
}
write_array(bin_output_file_fullpath, masks_im->image[0],