[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] Re: [Xen-devel] [PATCH 23/28] mini-os: fix various memory leaks in {fb, kbd}front
On Thu, Sep 19, 2013 at 12:39 AM, Andrew Cooper <andrew.cooper3@xxxxxxxxxx> wrote: > On 18/09/2013 04:37, Matthew Daley wrote: >> @@ -532,7 +538,8 @@ done: >> err = xenbus_wait_for_state_change(path, &state, &dev->events); >> if (state != XenbusStateConnected) { >> printk("backend not available, state=%d\n", state); >> - xenbus_unwatch_path_token(XBT_NIL, path, path); >> + if (err) free(err); > > free() is able to deal with being passed a NULL pointer. Therefore, the > "if (err)" is not needed. (And indeed, you dont use it in the next hunk) Right. I was just following the existing style, where it does have the redundant if()s - I count at least 22 cases in the existing code. I guess I can respin these mini-os patches, or I can do just one to remove both the newly added and the old cases across all of mini-os at once after these have gone in. - Matthew _______________________________________________ Xen-devel mailing list Xen-devel@xxxxxxxxxxxxx http://lists.xen.org/xen-devel
|
Lists.xenproject.org is hosted with RackSpace, monitoring our |