diff options
author | Andrew Tridgell <tridge@samba.org> | 2006-04-07 12:32:51 +0000 |
---|---|---|
committer | Gerald (Jerry) Carter <jerry@samba.org> | 2007-10-10 14:00:47 -0500 |
commit | 5b1a495e96be6f92df3ba2d30095d879041f757e (patch) | |
tree | 65c0b4f47c3867e38397de2d01275121637500f7 /source4/ntvfs/posix | |
parent | 5fb9da1b3f6e04cf9e9c4042532836651859f7e0 (diff) | |
download | samba-5b1a495e96be6f92df3ba2d30095d879041f757e.tar.gz samba-5b1a495e96be6f92df3ba2d30095d879041f757e.tar.bz2 samba-5b1a495e96be6f92df3ba2d30095d879041f757e.zip |
r14963: check talloc returns
(This used to be commit dd928e84ece04d35144befeda7a9b9dd597e4cf7)
Diffstat (limited to 'source4/ntvfs/posix')
-rw-r--r-- | source4/ntvfs/posix/pvfs_notify.c | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/source4/ntvfs/posix/pvfs_notify.c b/source4/ntvfs/posix/pvfs_notify.c index b5f2ad167a..592beb5a3e 100644 --- a/source4/ntvfs/posix/pvfs_notify.c +++ b/source4/ntvfs/posix/pvfs_notify.c @@ -109,12 +109,23 @@ 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; + struct notify_changes *n2; 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; + n2 = talloc_realloc(n, n->changes, struct notify_changes, n->num_changes+1); + if (n2 == NULL) { + /* nothing much we can do for this */ + return; + } + n->changes = n2; + new_path = talloc_strdup(n->changes, ev->path); + if (new_path == NULL) { + return; + } string_replace(new_path, '/', '\\'); + + n->changes[n->num_changes].action = ev->action; n->changes[n->num_changes].name.s = new_path; n->num_changes++; |