Skip to content

Commit

Permalink
Remove useless assignments on error
Browse files Browse the repository at this point in the history
Leave the output parameter untouched on error.
  • Loading branch information
rom1v committed Nov 14, 2021
1 parent 52cebe1 commit fd4ec78
Showing 1 changed file with 0 additions and 2 deletions.
2 changes: 0 additions & 2 deletions app/src/sys/win/process.c
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,6 @@ sc_process_execute_p(const char *const argv[], HANDLE *handle,

char *cmd = malloc(CMD_MAX_LEN);
if (!cmd || !build_cmd(cmd, CMD_MAX_LEN, argv)) {
*handle = NULL;
goto error_close_stderr;
}

Expand All @@ -98,7 +97,6 @@ sc_process_execute_p(const char *const argv[], HANDLE *handle,
if (!CreateProcessW(NULL, wide, NULL, NULL, TRUE, 0, NULL, NULL, &si,
&pi)) {
free(wide);
*handle = NULL;

if (GetLastError() == ERROR_FILE_NOT_FOUND) {
ret = SC_PROCESS_ERROR_MISSING_BINARY;
Expand Down

0 comments on commit fd4ec78

Please sign in to comment.