From 177c61bd72af3f8bf4bad5221e1ff67084bde397 Mon Sep 17 00:00:00 2001 From: Volker Lendecke Date: Fri, 9 Mar 2012 14:47:43 +0100 Subject: s3: asprintf->talloc_asprintf Autobuild-User: Volker Lendecke Autobuild-Date: Fri Mar 9 19:01:06 CET 2012 on sn-devel-104 --- source3/smbd/notify.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'source3') diff --git a/source3/smbd/notify.c b/source3/smbd/notify.c index 4357af412e..37d585b896 100644 --- a/source3/smbd/notify.c +++ b/source3/smbd/notify.c @@ -193,9 +193,11 @@ NTSTATUS change_notify_create(struct files_struct *fsp, uint32 filter, } /* Do notify operations on the base_name. */ - if (asprintf(&fullpath, "%s/%s", fsp->conn->connectpath, - fsp->fsp_name->base_name) == -1) { - DEBUG(0, ("asprintf failed\n")); + fullpath = talloc_asprintf( + talloc_tos(), "%s/%s", fsp->conn->connectpath, + fsp->fsp_name->base_name); + if (fullpath == NULL) { + DEBUG(0, ("talloc_asprintf failed\n")); TALLOC_FREE(fsp->notify); return NT_STATUS_NO_MEMORY; } @@ -211,7 +213,7 @@ NTSTATUS change_notify_create(struct files_struct *fsp, uint32 filter, } status = notify_add(fsp->conn->notify_ctx, &e, notify_callback, fsp); - SAFE_FREE(fullpath); + TALLOC_FREE(fullpath); return status; } -- cgit