提交 59467601 编写于 作者: J Jim Meyering

uml_driver.c: avoid leak upon failure

* src/uml/uml_driver.c (umlMonitorCommand): This function would
sometimes return -1, yet fail to free the "reply" it had allocated.
Hence, no caller would know to free the corresponding argument.
When returning -1, be sure to free all allocated resources.
上级 4a3d1ca3
/*
* uml_driver.c: core driver methods for managing UML guests
*
* Copyright (C) 2006, 2007, 2008, 2009 Red Hat, Inc.
* Copyright (C) 2006-2010 Red Hat, Inc.
* Copyright (C) 2006-2008 Daniel P. Berrange
*
* This library is free software; you can redistribute it and/or
......@@ -757,6 +757,9 @@ static int umlMonitorCommand(virConnectPtr conn,
VIR_DEBUG("Command reply is '%s'", NULLSTR(retdata));
if (ret < 0)
VIR_FREE(retdata);
else
*reply = retdata;
return ret;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册