From e8a77df79e73599bb18f30c139edeece45846239 Mon Sep 17 00:00:00 2001 From: Volker Lendecke Date: Sun, 20 Oct 2013 17:16:11 +0200 Subject: ntvfs: Fix CID 1107225 Resource leak After the talloc_strdup, we don't need cwd anymore. Signed-off-by: Volker Lendecke Reviewed-by: Jeremy Allison --- source4/ntvfs/posix/pvfs_sys.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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; } -- cgit