Skip to content

Commit

Permalink
Linux: drop preconditions for free_and_xStrdup()
Browse files Browse the repository at this point in the history
free_and_xStrdup() internally skips the strdup() allocation if both
strings exist are are the same.  Drop such conditions prior of a call.
  • Loading branch information
cgzones committed Jan 20, 2024
1 parent 8e11f1f commit 207db2e
Showing 1 changed file with 0 additions and 6 deletions.
6 changes: 0 additions & 6 deletions linux/LinuxProcessTable.c
Original file line number Diff line number Diff line change
Expand Up @@ -985,9 +985,6 @@ static void LinuxProcessTable_readSecattrData(LinuxProcess* process, openat_arg_

Row_updateFieldWidth(SECATTR, strlen(buffer));

if (process->secattr && String_eq(process->secattr, buffer)) {
return;
}
free_and_xStrdup(&process->secattr, buffer);
}

Expand All @@ -1008,9 +1005,6 @@ static void LinuxProcessTable_readCwd(LinuxProcess* process, openat_arg_t procFd

pathBuffer[r] = '\0';

if (process->super.procCwd && String_eq(process->super.procCwd, pathBuffer))
return;

free_and_xStrdup(&process->super.procCwd, pathBuffer);
}

Expand Down

0 comments on commit 207db2e

Please sign in to comment.