]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
s3: asprintf->talloc_asprintf
authorVolker Lendecke <vl@samba.org>
Fri, 9 Mar 2012 13:47:43 +0000 (14:47 +0100)
committerVolker Lendecke <vl@samba.org>
Fri, 9 Mar 2012 18:01:06 +0000 (19:01 +0100)
Autobuild-User: Volker Lendecke <vl@samba.org>
Autobuild-Date: Fri Mar  9 19:01:06 CET 2012 on sn-devel-104

source3/smbd/notify.c

index 4357af412ee080563ddcdd1e80b91798e02e1abd..37d585b89602d07b1ceea8665b12f2b4f1404b7c 100644 (file)
@@ -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;
 }