Merge "effects: fix a theoretical memory leak"

gugelfrei
George Burgess IV 5 years ago committed by Gerrit Code Review
commit 7f4beda2de

@ -1856,12 +1856,13 @@ status_t AudioFlinger::EffectHandle::command(uint32_t cmdCode,
} }
// copy to local memory in case of client corruption b/32220769 // copy to local memory in case of client corruption b/32220769
param = (effect_param_t *)realloc(param, size); auto *newParam = (effect_param_t *)realloc(param, size);
if (param == NULL) { if (newParam == NULL) {
ALOGW("command(): out of memory"); ALOGW("command(): out of memory");
status = NO_MEMORY; status = NO_MEMORY;
break; break;
} }
param = newParam;
memcpy(param, p, size); memcpy(param, p, size);
int reply = 0; int reply = 0;

Loading…
Cancel
Save