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:
parent
7f9b2c1739
commit
1563250410
1 changed files with 4 additions and 9 deletions
|
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue