From 09eb876ac0f23f840042aed9bc891d25520636e8 Mon Sep 17 00:00:00 2001 From: Stefan Metzmacher Date: Fri, 7 Apr 2006 12:11:50 +0000 Subject: r14961: fix compiler warning tridge: please add checks after talloc_realloc() and talloc_strdup()! metze (This used to be commit c136191870f91d4ce652da535a1cd52f4772574d) --- source4/ntvfs/posix/pvfs_notify.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'source4/ntvfs') diff --git a/source4/ntvfs/posix/pvfs_notify.c b/source4/ntvfs/posix/pvfs_notify.c index 652a5260d5..b5f2ad167a 100644 --- a/source4/ntvfs/posix/pvfs_notify.c +++ b/source4/ntvfs/posix/pvfs_notify.c @@ -109,11 +109,13 @@ static void pvfs_notify_callback(void *private, const struct notify_event *ev) { struct pvfs_notify_buffer *n = talloc_get_type(private, struct pvfs_notify_buffer); size_t len; + char *new_path; n->changes = talloc_realloc(n, n->changes, struct notify_changes, n->num_changes+1); n->changes[n->num_changes].action = ev->action; - n->changes[n->num_changes].name.s = talloc_strdup(n->changes, ev->path); - string_replace(n->changes[n->num_changes].name.s, '/', '\\'); + new_path = talloc_strdup(n->changes, ev->path); + string_replace(new_path, '/', '\\'); + n->changes[n->num_changes].name.s = new_path; n->num_changes++; /* -- cgit