Patch fuite de mémoire

This commit is contained in:
rick 2021-02-18 00:13:25 +01:00
parent 7a05a3fb5f
commit adf0649a91
Signed by: Rick
GPG key ID: 2B593F087240EE99

View file

@ -80,7 +80,14 @@ int main()
get_command(commands, '|'); get_command(commands, '|');
if (pipe(my_pipe) == -1) if (pipe(my_pipe) == -1)
{
for (int i = 0; i < MAX_LENGTH; i++)
{
free(args[i]);
free(commands[i]);
}
error(1, FATAL_ERROR, NULL); error(1, FATAL_ERROR, NULL);
}
index = 0; index = 0;
} }