svn commit: samba r14963 - in
branches/SAMBA_4_0/source/ntvfs/posix: .
tridge at samba.org
tridge at samba.org
Fri Apr 7 12:32:52 GMT 2006
Author: tridge
Date: 2006-04-07 12:32:51 +0000 (Fri, 07 Apr 2006)
New Revision: 14963
WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=14963
Log:
check talloc returns
Modified:
branches/SAMBA_4_0/source/ntvfs/posix/pvfs_notify.c
Changeset:
Modified: branches/SAMBA_4_0/source/ntvfs/posix/pvfs_notify.c
===================================================================
--- branches/SAMBA_4_0/source/ntvfs/posix/pvfs_notify.c 2006-04-07 12:19:29 UTC (rev 14962)
+++ branches/SAMBA_4_0/source/ntvfs/posix/pvfs_notify.c 2006-04-07 12:32:51 UTC (rev 14963)
@@ -109,12 +109,23 @@
{
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++;
More information about the samba-cvs
mailing list