}
/* 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;
}
}
status = notify_add(fsp->conn->notify_ctx, &e, notify_callback, fsp);
- SAFE_FREE(fullpath);
+ TALLOC_FREE(fullpath);
return status;
}