summaryrefslogtreecommitdiff
path: root/source4/ntvfs
diff options
context:
space:
mode:
authorVolker Lendecke <vl@samba.org>2013-10-20 17:16:11 +0200
committerJeremy Allison <jra@samba.org>2013-10-21 16:34:35 -0700
commite8a77df79e73599bb18f30c139edeece45846239 (patch)
treef975cd073371b7701a8129abbb7e1c05fc6ab53c /source4/ntvfs
parentee78af33fe5c9d84de35bbb0687b6d185abc8cf6 (diff)
downloadsamba-e8a77df79e73599bb18f30c139edeece45846239.tar.gz
samba-e8a77df79e73599bb18f30c139edeece45846239.tar.bz2
samba-e8a77df79e73599bb18f30c139edeece45846239.zip
ntvfs: Fix CID 1107225 Resource leak
After the talloc_strdup, we don't need cwd anymore. Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
Diffstat (limited to 'source4/ntvfs')
-rw-r--r--source4/ntvfs/posix/pvfs_sys.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/source4/ntvfs/posix/pvfs_sys.c b/source4/ntvfs/posix/pvfs_sys.c
index 5775d0bb77..eb710f6651 100644
--- a/source4/ntvfs/posix/pvfs_sys.c
+++ b/source4/ntvfs/posix/pvfs_sys.c
@@ -196,9 +196,11 @@ static struct pvfs_sys_ctx *pvfs_sys_pushdir(struct pvfs_state *pvfs,
talloc_free(ctx);
return NULL;
}
+
ctx->old_wd = talloc_strdup(ctx, cwd);
+ free(cwd);
+
if (ctx->old_wd == NULL) {
- free(cwd);
talloc_free(ctx);
return NULL;
}