Review radio metadata allocations/deallocations.

Bug: b/34054813
Test: VTS, manual
Change-Id: I1cbd7baf5b852cd3d4cab374eb67289f3938fff3
This commit is contained in:
Tomasz Wasilczyk 2017-02-15 16:57:20 -08:00
parent 3e9a5396b0
commit 33683bf92b

View file

@ -613,7 +613,12 @@ static int tuner_get_program_information(const struct radio_tuner *tuner,
metadata = info->metadata;
*info = stub_tuner->program;
info->metadata = metadata;
if (metadata != NULL && stub_tuner->program.metadata != NULL)
if (metadata == NULL) {
ALOGE("%s metadata is a nullptr", __func__);
status = -EINVAL;
goto exit;
}
if (stub_tuner->program.metadata != NULL)
radio_metadata_add_metadata(&info->metadata, stub_tuner->program.metadata);
exit: