Fixed memleak when setting string for none string cg_var type
This commit is contained in:
parent
9fb9024675
commit
2e71cdbab7
1 changed files with 2 additions and 0 deletions
|
|
@ -2885,6 +2885,8 @@ yang_abs_schema_nodeid(yang_stmt *yn,
|
|||
/* If p0 is NULL an entry will be: [i0] which needs to be transformed to [NULL:i0] */
|
||||
cv = NULL;
|
||||
while ((cv = cvec_each(nodeid_cvv, cv)) != NULL){
|
||||
if (cv_type_get(cv) != CGV_STRING)
|
||||
cv_type_set(cv, CGV_STRING);
|
||||
if ((str = cv_string_get(cv)) == NULL || !strlen(str)){
|
||||
if (cv_string_set(cv, cv_name_get(cv)) < 0){
|
||||
clicon_err(OE_UNIX, errno, "cv_string_set");
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue