This is an archive of the discontinued LLVM Phabricator instance.

Move close() to the proper else block
ClosedPublic

Authored by yingcong-wu on Mar 1 2023, 12:10 AM.

Details

Summary

LogWriter::Close(LW) is outside the null check if-else block, which, when LW == nullptr, will causing a NULL dereference.
I think the close() means to be in else block, which is when LW != nullptr.

Diff Detail

Event Timeline

yingcong-wu created this revision.Mar 1 2023, 12:10 AM
Herald added a project: Restricted Project. · View Herald TranscriptMar 1 2023, 12:10 AM
Herald added a subscriber: Enna1. · View Herald Transcript
yingcong-wu requested review of this revision.Mar 1 2023, 12:10 AM
Herald added a project: Restricted Project. · View Herald TranscriptMar 1 2023, 12:10 AM
Herald added a subscriber: Restricted Project. · View Herald Transcript
xgupta accepted this revision.EditedMar 1 2023, 5:32 AM

LGTM, Thanks.
Seems reasonable.

This revision is now accepted and ready to land.Mar 1 2023, 5:32 AM
This revision was automatically updated to reflect the committed changes.