From efcd8584f19a411200d72d585138b8ab0983d2ec Mon Sep 17 00:00:00 2001 From: h_vogt Date: Mon, 28 Mar 2016 14:43:35 +0200 Subject: [PATCH] error.c, ft_sperror(), memory leak, free memory returned by `if_errstring()' --- src/frontend/error.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/frontend/error.c b/src/frontend/error.c index 485343146..9fb3daf32 100644 --- a/src/frontend/error.c +++ b/src/frontend/error.c @@ -53,7 +53,9 @@ fperror(char *mess, int code) void 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); }