r14961: fix compiler warning
authorStefan Metzmacher <metze@samba.org>
Fri, 7 Apr 2006 12:11:50 +0000 (12:11 +0000)
committerGerald (Jerry) Carter <jerry@samba.org>
Wed, 10 Oct 2007 19:00:46 +0000 (14:00 -0500)
tridge: please add checks after talloc_realloc() and talloc_strdup()!

metze

source/ntvfs/posix/pvfs_notify.c

index 652a5260d58c53e5c64ab4c58f6df88fa7c3cdbe..b5f2ad167aaeae6c7864af2a90d1cc884e5ffe20 100644 (file)
@@ -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++;
 
        /*