1
0
mirror of https://github.com/samba-team/samba.git synced 2025-01-11 05:18:09 +03:00

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>
This commit is contained in:
Volker Lendecke 2013-10-20 17:16:11 +02:00 committed by Jeremy Allison
parent ee78af33fe
commit e8a77df79e

View File

@ -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;
}