[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Xen-devel] [PATCH 24/28] mini-os: fix various memory leaks in netfront
Coverity-ID: 1055832 Coverity-ID: 1055833 Signed-off-by: Matthew Daley <mattjd@xxxxxxxxx> --- extras/mini-os/netfront.c | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/extras/mini-os/netfront.c b/extras/mini-os/netfront.c index a999985..3a5be64 100644 --- a/extras/mini-os/netfront.c +++ b/extras/mini-os/netfront.c @@ -506,7 +506,7 @@ int netfront_tap_open(char *nodename) { void shutdown_netfront(struct netfront_dev *dev) { - char* err = NULL; + char* err = NULL, *err2; XenbusState state; char path[strlen(dev->backend) + strlen("/state") + 1]; @@ -549,16 +549,21 @@ void shutdown_netfront(struct netfront_dev *dev) close: if (err) free(err); - xenbus_unwatch_path_token(XBT_NIL, path, path); + err2 = xenbus_unwatch_path_token(XBT_NIL, path, path); + if (err2) free(err2); snprintf(nodename, sizeof(nodename), "%s/tx-ring-ref", dev->nodename); - xenbus_rm(XBT_NIL, nodename); + err2 = xenbus_rm(XBT_NIL, nodename); + if (err2) free(err2); snprintf(nodename, sizeof(nodename), "%s/rx-ring-ref", dev->nodename); - xenbus_rm(XBT_NIL, nodename); + err2 = xenbus_rm(XBT_NIL, nodename); + if (err2) free(err2); snprintf(nodename, sizeof(nodename), "%s/event-channel", dev->nodename); - xenbus_rm(XBT_NIL, nodename); + err2 = xenbus_rm(XBT_NIL, nodename); + if (err2) free(err2); snprintf(nodename, sizeof(nodename), "%s/request-rx-copy", dev->nodename); - xenbus_rm(XBT_NIL, nodename); + err2 = xenbus_rm(XBT_NIL, nodename); + if (err2) free(err2); if (!err) free_netfront(dev); -- 1.7.10.4 _______________________________________________ Xen-devel mailing list Xen-devel@xxxxxxxxxxxxx http://lists.xen.org/xen-devel
|
Lists.xenproject.org is hosted with RackSpace, monitoring our |