]> asedeno.scripts.mit.edu Git - PuTTY.git/commitdiff
There's always one: fix small memory leak introduced in last revision.
authorSimon Tatham <anakin@pobox.com>
Sat, 1 Jan 2005 13:01:13 +0000 (13:01 +0000)
committerSimon Tatham <anakin@pobox.com>
Sat, 1 Jan 2005 13:01:13 +0000 (13:01 +0000)
[originally from svn r5056]

psftp.c

diff --git a/psftp.c b/psftp.c
index 508ab8cdce044c0b0e0aacaa5e62e44f7d98e391..48c12a4e3330b006a10e9908fb6801ebdef3bb5b 100644 (file)
--- a/psftp.c
+++ b/psftp.c
@@ -1588,6 +1588,7 @@ int sftp_cmd_mv(struct sftp_command *cmd)
     if ((cmd->nwords > 3 || is_wildcard(cmd->words[1])) && !ctx->dest_is_dir) {
        printf("mv: multiple or wildcard arguments require the destination"
               " to be a directory\n");
+       sfree(ctx->dstfname);
        return 0;
     }
 
@@ -1598,6 +1599,7 @@ int sftp_cmd_mv(struct sftp_command *cmd)
     for (i = 1; i < cmd->nwords-1; i++)
        ret &= wildcard_iterate(cmd->words[i], sftp_action_mv, ctx);
 
+    sfree(ctx->dstfname);
     return ret;
 }