]> Sergey Matveev's repositories - nnn.git/commitdiff
Fix memory leak
authorArun Prakash Jana <engineerarun@gmail.com>
Tue, 22 Jun 2021 15:21:23 +0000 (20:51 +0530)
committerArun Prakash Jana <engineerarun@gmail.com>
Tue, 22 Jun 2021 15:21:23 +0000 (20:51 +0530)
src/nnn.c

index 46d86d6d5549f599019458d18679939815ce3977..cba66a0d62a2e743625a6e86248bc2e6e89d301f 100644 (file)
--- a/src/nnn.c
+++ b/src/nnn.c
@@ -4332,9 +4332,11 @@ static bool handle_archive(char *fpath /* in-out param */, char op)
        if (x_to) {
                if (chdir(xdirname(fpath)) == -1) {
                        printwarn(NULL);
+                       free(outdir);
                        return FALSE;
                }
                xstrsncpy(fpath, outdir, PATH_MAX);
+               free(outdir);
        } else if (op == 'x')
                fpath[0] = '\0';