commit 1e4216f456a14f42c1fa67f73fe8bcddac9a93c6
parent 2add52650ba64c2d4d7f9ef3d2c1bf07276cea91
Author: Paco Esteban <paco@e1e0.net>
Date: Fri, 12 Feb 2021 15:44:19 +0100
fix process_dir leaks
Diffstat:
1 file changed, 3 insertions(+), 4 deletions(-)
diff --git a/ssnail.c b/ssnail.c
@@ -482,13 +482,12 @@ process_dir(char *src, char *dst, int force)
}
if (dp->d_type == DT_DIR)
error = process_dir(src_path, dst_path, force);
+
+ free(src_path);
+ free(dst_path);
}
out:
- free(src_path);
- free(dst_path);
- src_path = NULL;
- dst_path = NULL;
closedir(dirp);
return error;
}