Ticket: CM-6790
Reviewed by: CCR-3453
Testing: See bug
This code change fixes these things:
(a) Fixes an assert followed by an if statement
(B) Fixes the memory leak in aspath->json
/* Malformed AS path value. */
assert (aspath->str);
- if (! aspath->str)
- return NULL;
/* New aspath structure is needed. */
new = XMALLOC (MTYPE_AS_PATH, sizeof (struct aspath));
assegment_free_all (as.segments);
/* aspath_key_make() always updates the string */
XFREE (MTYPE_AS_STR, as.str);
+ if (as.json)
+ {
+ json_object_free(as.json);
+ as.json = NULL;
+ }
}
find->refcnt++;