memleaks
This commit is contained in:
parent
b894c30bfb
commit
deb89600ed
23 changed files with 50 additions and 31 deletions
|
|
@ -333,6 +333,8 @@ validate_identityref(cxobj *xt,
|
|||
}
|
||||
retval = 0;
|
||||
done:
|
||||
if (cb)
|
||||
cbuf_free(cb);
|
||||
return retval;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -326,6 +326,10 @@ xp_eval_step(xp_ctx *xc0,
|
|||
if (cxvec_append(xp, &xc->xc_nodeset, &xc->xc_size) < 0)
|
||||
goto done;
|
||||
}
|
||||
if (vec){
|
||||
free(vec);
|
||||
vec = NULL;
|
||||
}
|
||||
break;
|
||||
case A_PRECEEDING:
|
||||
break;
|
||||
|
|
@ -1080,8 +1084,10 @@ xpath_vec_ctx(cxobj *xcur,
|
|||
goto done;
|
||||
if (xp_eval(&xc, xy.xy_top, xrp) < 0)
|
||||
goto done;
|
||||
if (xc.xc_nodeset)
|
||||
if (xc.xc_nodeset){
|
||||
free(xc.xc_nodeset);
|
||||
xc.xc_nodeset = NULL;
|
||||
}
|
||||
/* done: */
|
||||
xpath_parse_exit(&xy);
|
||||
xpath_scan_exit(&xy);
|
||||
|
|
|
|||
|
|
@ -1616,7 +1616,6 @@ yang_parse_str(char *str,
|
|||
yy.yy_parse_string = str;
|
||||
yy.yy_stack = NULL;
|
||||
yy.yy_module = NULL; /* this is the return value - the module/sub-module */
|
||||
|
||||
if (ystack_push(&yy, (yang_node*)yspec) == NULL)
|
||||
goto done;
|
||||
if (strlen(str)){ /* Not empty */
|
||||
|
|
@ -1640,6 +1639,8 @@ yang_parse_str(char *str,
|
|||
ymod = yy.yy_module;
|
||||
done:
|
||||
ystack_pop(&yy);
|
||||
if (yy.yy_stack)
|
||||
free (yy.yy_stack);
|
||||
return ymod; /* top-level (sub)module */
|
||||
}
|
||||
|
||||
|
|
@ -2281,7 +2282,7 @@ ys_parse(yang_stmt *ys,
|
|||
* That is, siblings, etc, may not be there. Complete checks are made in
|
||||
* ys_populate instead.
|
||||
* @param[in] ys yang statement
|
||||
* @param[in] extra Yang extra for cornercases (unknown/extension)
|
||||
* @param[in] extra Yang extra for cornercases (unknown/extension).
|
||||
*
|
||||
* The cv:s created in parse-tree as follows:
|
||||
* fraction-digits : Create cv as uint8, check limits [1:8] (must be made in 1st pass)
|
||||
|
|
@ -2335,12 +2336,11 @@ ys_parse_sub(yang_stmt *ys,
|
|||
clicon_err(OE_YANG, errno, "Parsing CV: %s", reason);
|
||||
goto done;
|
||||
}
|
||||
free(extra);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
ok:
|
||||
ok:
|
||||
retval = 0;
|
||||
done:
|
||||
if (prefix)
|
||||
|
|
|
|||
|
|
@ -343,8 +343,9 @@ unknown_stmt : ustring ':' ustring ';'
|
|||
}
|
||||
| ustring ':' ustring ' ' string ';'
|
||||
{ char *id; if ((id=prefix_id_join($1, $3)) == NULL) _YYERROR("0");
|
||||
if (ysp_add(_yy, Y_UNKNOWN, id, $5) == NULL) _YYERROR("0");
|
||||
if (ysp_add(_yy, Y_UNKNOWN, id, $5) == NULL){ _YYERROR("0"); }
|
||||
clicon_debug(2,"unknown-stmt -> ustring : ustring string");
|
||||
if ($5) free($5);
|
||||
}
|
||||
;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue