error.c, ft_sperror(), memory leak, free memory returned by `if_errstring()'
This commit is contained in:
parent
5611ca4f10
commit
efcd8584f1
|
|
@ -53,7 +53,9 @@ fperror(char *mess, int code)
|
||||||
void
|
void
|
||||||
ft_sperror(int code, char *mess)
|
ft_sperror(int code, char *mess)
|
||||||
{
|
{
|
||||||
fprintf(cp_err, "%s: %s\n", mess, if_errstring(code));
|
char *errstring = if_errstring(code);
|
||||||
|
fprintf(cp_err, "%s: %s\n", mess, errstring);
|
||||||
|
tfree(errstring);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue