On 09/27/2011 02:25 AM, ajia(a)redhat.com wrote:
From: Alex Jia<ajia(a)redhat.com>
* src/ncftool.c: Calling allocation function 'ncf_lookup_by_name' to allocate
memory to 'nif', however, it hasn't been released before return.
Signed-off-by: Alex Jia<ajia(a)redhat.com>
---
src/ncftool.c | 4 +++-
1 files changed, 3 insertions(+), 1 deletions(-)
diff --git a/src/ncftool.c b/src/ncftool.c
index c9e26a2..90c6cbf 100644
--- a/src/ncftool.c
+++ b/src/ncftool.c
@@ -390,8 +390,10 @@ static int cmd_undefine(const struct command *cmd) {
return CMD_RES_ERR;
r = ncf_if_undefine(nif);
- if (r< 0)
+ if (r< 0) {
+ ncf_if_free(nif);
return CMD_RES_ERR;
+ }
printf("%s undefined\n", name);
ncf_if_free(nif);
ACK and pushed. Thanks for noticing that in the coverity output!