Skip to content
Snippets Groups Projects

musicbrainz: small fix, refactor and plug leak

Merged Johannes Kauffmann requested to merge JohannesKauffmann/vlc2:false-null into master
1 file
+ 17
13
Compare changes
  • Side-by-side
  • Inline
@@ -55,22 +55,26 @@ static musicbrainz_lookup_t * musicbrainz_lookup(vlc_object_t *p_obj, const char
return NULL;
musicbrainz_lookup_t *p_lookup = musicbrainz_lookup_new();
if(p_lookup)
if (!p_lookup)
{
struct json_helper_sys sys;
sys.logger = p_obj->logger;
sys.buffer = p_buffer;
sys.size = i_buffer;
int val = json_parse(&sys, &p_lookup->json);
if (val) {
msg_Dbg( p_obj, "error: could not parse json!");
free(p_buffer);
return false;
}
free(p_buffer);
return NULL;
}
struct json_helper_sys sys;
sys.logger = p_obj->logger;
sys.buffer = p_buffer;
sys.size = i_buffer;
int val = json_parse(&sys, &p_lookup->json);
free(p_buffer);
if (val)
{
msg_Dbg( p_obj, "error: could not parse json!");
musicbrainz_lookup_release(p_lookup);
return NULL;
}
return p_lookup;
}
Loading