mirror of https://gitee.com/openkylin/libvirt.git
Fix memory leak in openvz_conf.c
If there is no error while executing a function "openvzParseBarrierLimit" a "str" string where is duplicate of a "value" string isn't freed and it leads into memory leak. This has been found by coverity. Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
This commit is contained in:
parent
ba906a3d58
commit
7ed02a0003
|
@ -136,6 +136,7 @@ openvzParseBarrierLimit(const char* value,
|
|||
char *token;
|
||||
char *saveptr = NULL;
|
||||
char *str;
|
||||
int ret = -1;
|
||||
|
||||
if (VIR_STRDUP(str, value) < 0)
|
||||
goto error;
|
||||
|
@ -158,10 +159,10 @@ openvzParseBarrierLimit(const char* value,
|
|||
goto error;
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
ret = 0;
|
||||
error:
|
||||
VIR_FREE(str);
|
||||
return -1;
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue