Memory leak in cli load_config_file
This commit is contained in:
parent
bed6d3c739
commit
b0d38a513c
1 changed files with 3 additions and 2 deletions
|
|
@ -828,7 +828,7 @@ load_config_file(clicon_handle h,
|
||||||
FILE *fp = NULL;
|
FILE *fp = NULL;
|
||||||
cxobj *xt = NULL;
|
cxobj *xt = NULL;
|
||||||
cxobj *x;
|
cxobj *x;
|
||||||
cbuf *cbxml;
|
cbuf *cbxml = NULL;
|
||||||
char *formatstr = NULL;
|
char *formatstr = NULL;
|
||||||
enum format_enum format = FORMAT_XML;
|
enum format_enum format = FORMAT_XML;
|
||||||
yang_stmt *yspec;
|
yang_stmt *yspec;
|
||||||
|
|
@ -952,10 +952,11 @@ load_config_file(clicon_handle h,
|
||||||
replace?OP_REPLACE:OP_MERGE,
|
replace?OP_REPLACE:OP_MERGE,
|
||||||
cbuf_get(cbxml)) < 0)
|
cbuf_get(cbxml)) < 0)
|
||||||
goto done;
|
goto done;
|
||||||
cbuf_free(cbxml);
|
|
||||||
ok:
|
ok:
|
||||||
ret = 0;
|
ret = 0;
|
||||||
done:
|
done:
|
||||||
|
if (cbxml)
|
||||||
|
cbuf_free(cbxml);
|
||||||
if (lineptr)
|
if (lineptr)
|
||||||
free(lineptr);
|
free(lineptr);
|
||||||
if (xerr)
|
if (xerr)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue