Check for null ferr

fout is double checked for nullptr instead of ferr which forces
to call fclose on null ferr.

Test: atest incidentd_test
Test: m incidentd_service_fuzzer && adb sync data && adb shell /data/fuzz/x86_64/incidentd_service_fuzzer/incidentd_service_fuzzer
with clusterfuzz testcase
Bug: 283453191

Change-Id: I3a4912cf70f4f32cb66fb870febbbfff1a7c6adc
This commit is contained in:
Pawan Wagh
2023-05-19 21:18:01 +00:00
parent 3c3e36876f
commit 428871d044

View File

@@ -536,7 +536,7 @@ status_t IncidentService::onTransact(uint32_t code, const Parcel& data, Parcel*
fflush(fout);
fclose(fout);
}
if (fout != NULL) {
if (ferr != NULL) {
fflush(ferr);
fclose(ferr);
}