Mateusz Guzik wrote this message on Thu, Jan 23, 2014 at 21:17 +0100: > On Thu, Jan 23, 2014 at 07:31:17PM +0000, Andrey V. Elsukov wrote: > > @@ -122,7 +123,7 @@ geom_alloc_copyin(struct gctl_req *req, > > void *ptr; > > > > ptr = g_malloc(len, M_WAITOK); > > - nreq->nerror = copyin(uaddr, ptr, len); > > + req->nerror = copyin(uaddr, ptr, len); > > if (!req->nerror) > > return (ptr); > > if (ptr != NULL) > > Is not this if (ptr != NULL) unnecesary?
The code: if (!req->nerror) return (ptr); if (ptr != NULL) g_free(ptr); return (NULL); If anything, the if statement can be removed, but the g_free needs to remain, otherwise there will be a memory leak... -- John-Mark Gurney Voice: +1 415 225 5579 "All that I will do, has been done, All that I have, has not." _______________________________________________ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"