NetlinkEvent: trivial simplification.

free(NULL) is defined as a no-op. Don't overcomplicate things.

Bug: http://b/287138549
Test: treehugger
Change-Id: I9ae532a71f986d9468f191972a9b7acf6e709d13
This commit is contained in:
Elliott Hughes 2023-07-10 22:03:11 +00:00
parent 7f9b2c1739
commit 1563250410

View file

@ -150,15 +150,10 @@ NetlinkEvent::NetlinkEvent() {
}
NetlinkEvent::~NetlinkEvent() {
int i;
if (mPath)
free(mPath);
if (mSubsystem)
free(mSubsystem);
for (i = 0; i < NL_PARAMS_MAX; i++) {
if (!mParams[i])
break;
free(mParams[i]);
free(mPath);
free(mSubsystem);
for (auto param : mParams) {
free(param);
}
}