summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--qacp.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/qacp.c b/qacp.c
index a8862e7..0a79f1e 100644
--- a/qacp.c
+++ b/qacp.c
@@ -572,12 +572,14 @@ sendfiles(char **argv, int argc, int fileidx, short recursive)
destpath = strdup(rmtpath);
}
} else {
+ struct qp_rstat_pkt *tmprstatp;
+
/* rmtpath does not exist, check if the dirname does */
tmpstr = strdup(rmtpath);
rdnp = strdup(dirname(tmpstr));
free(tmpstr);
- rstatp = qacp_rstat(rdnp, &rstaterrno);
+ tmprstatp = qacp_rstat(rdnp, &rstaterrno);
free(rdnp);
if (rstatp) {
@@ -586,8 +588,8 @@ sendfiles(char **argv, int argc, int fileidx, short recursive)
* that /tmp exists, we leave destpath == rmtpath.
*/
destpath = strdup(rmtpath);
- free(rstatp->qp_path);
- free(rstatp);
+ free(tmprstatp->qp_path);
+ free(tmprstatp);
} else {
fprintf(stderr, "%s:%s - %s\n", rhost, rmtpath,
strerror(rstaterrno));
@@ -600,14 +602,15 @@ sendfiles(char **argv, int argc, int fileidx, short recursive)
free(lbnp);
free(destpath);
- free(rmtpath);
}
if (rstatp) {
free(rstatp->qp_path);
free(rstatp);
}
+
free(ruser);
+ free(rmtpath);
return 0;
}