mirror of
https://github.com/radareorg/radare2.git
synced 2024-12-01 00:51:19 +00:00
Fix two memleaks in r_json and r_x509
This commit is contained in:
parent
9523beb3bf
commit
aa8a5fdb30
@ -136,6 +136,7 @@ R_API void r_json_object_add (RJSVar* object, const char* name, RJSVar* value) {
|
||||
}
|
||||
c = (char**) realloc (object->object.n, len * sizeof (char*));
|
||||
if (!c) {
|
||||
free (v);
|
||||
return;
|
||||
}
|
||||
v[len - 1] = value;
|
||||
|
@ -820,7 +820,10 @@ RJSVar *r_x509_extensions_json (RX509Extensions* exts) {
|
||||
for (i = 0; i < exts->length; ++i) {
|
||||
RX509Extension *e = exts->extensions[i];
|
||||
RJSVar* obj = r_json_object_new ();
|
||||
if (!e || !obj) continue;
|
||||
if (!e || !obj) {
|
||||
r_json_var_free (obj);
|
||||
continue;
|
||||
}
|
||||
if (e->extnID) {
|
||||
r_json_object_add (obj, "OID", r_json_string_new (e->extnID->string));
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user