Fixed a potential memory leak.
This commit is contained in:
parent
85f926efaa
commit
0f13ea2a84
@ -264,9 +264,9 @@ static int client_interface_init(struct libvchan *ctrl, int domain, int devno)
|
|||||||
if (!ref)
|
if (!ref)
|
||||||
goto fail;
|
goto fail;
|
||||||
ctrl->ring_ref = atoi(ref);
|
ctrl->ring_ref = atoi(ref);
|
||||||
|
free(ref);
|
||||||
if (!ctrl->ring_ref)
|
if (!ctrl->ring_ref)
|
||||||
goto fail;
|
goto fail;
|
||||||
free(ref);
|
|
||||||
snprintf(buf, sizeof buf,
|
snprintf(buf, sizeof buf,
|
||||||
"/local/domain/%d/device/vchan/%d/event-channel", domain,
|
"/local/domain/%d/device/vchan/%d/event-channel", domain,
|
||||||
devno);
|
devno);
|
||||||
@ -274,9 +274,9 @@ static int client_interface_init(struct libvchan *ctrl, int domain, int devno)
|
|||||||
if (!ref)
|
if (!ref)
|
||||||
goto fail;
|
goto fail;
|
||||||
remote_port = atoi(ref);
|
remote_port = atoi(ref);
|
||||||
|
free(ref);
|
||||||
if (!remote_port)
|
if (!remote_port)
|
||||||
goto fail;
|
goto fail;
|
||||||
free(ref);
|
|
||||||
#ifdef XENCTRL_HAS_XC_INTERFACE
|
#ifdef XENCTRL_HAS_XC_INTERFACE
|
||||||
xcfd = xc_interface_open(NULL, NULL, 0);
|
xcfd = xc_interface_open(NULL, NULL, 0);
|
||||||
if (!xcfd)
|
if (!xcfd)
|
||||||
|
Loading…
Reference in New Issue
Block a user