]> gitweb.hhaalo.de Git - mv_none_space.git/commitdiff
fix memory leak
authorBastian Dehn <hhaalo@arcor.de>
Fri, 3 Oct 2025 07:44:07 +0000 (09:44 +0200)
committerBastian Dehn <hhaalo@arcor.de>
Fri, 3 Oct 2025 07:44:07 +0000 (09:44 +0200)
src/main.c

index d5a811e968ce3543fab38c3d15ce9b4be82b9d41..3fd4b370511721286314512e54b0a8b34b1a14b1 100644 (file)
@@ -56,13 +56,14 @@ void rename_files(const char* dir_path, rename_ptr renamefunc)
                        dirname = escape(output);
                        rename_files(dirname, renamefunc);
                }
+
+               free(output);
+               output = NULL;
        }
 
        globfree(files);
        free(files);
        files = NULL;
-       free(output);
-       output = NULL;
        free(dirname);
        dirname = NULL;
 }