From 421ff99f5d33c4be72f56f09d82f6ba6fe1bea5c Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Sat, 2 Oct 2004 13:29:20 +0000 Subject: r2788: prevent a memory leak in the pvfs search backend (This used to be commit 1de22070610231e60d329f56997bbec2cc674a4e) --- source4/ntvfs/posix/pvfs_shortname.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'source4/ntvfs/posix/pvfs_shortname.c') diff --git a/source4/ntvfs/posix/pvfs_shortname.c b/source4/ntvfs/posix/pvfs_shortname.c index 33e601e429..21c0ca6ea0 100644 --- a/source4/ntvfs/posix/pvfs_shortname.c +++ b/source4/ntvfs/posix/pvfs_shortname.c @@ -38,8 +38,10 @@ char *pvfs_short_name_component(struct pvfs_state *pvfs, const char *name) return the short name for a given entry in a directory TODO: this is obviously not very useful in its current form ! */ -char *pvfs_short_name(struct pvfs_state *pvfs, struct pvfs_filename *name) +char *pvfs_short_name(struct pvfs_state *pvfs, TALLOC_CTX *mem_ctx, struct pvfs_filename *name) { char *p = strrchr(name->full_name, '/'); - return pvfs_short_name_component(pvfs, p+1); + char *ret = pvfs_short_name_component(pvfs, p+1); + talloc_steal(mem_ctx, ret); + return ret; } -- cgit