From 79c501098e422e70da80a670e213c5f7b605d0e1 Mon Sep 17 00:00:00 2001 From: George Peter Banyard Date: Fri, 30 Dec 2022 15:11:09 +0000 Subject: [PATCH] Fix memory leak in posix_ttyname() --- ext/posix/posix.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ext/posix/posix.c b/ext/posix/posix.c index e6655f0d95b3b..d32f1cfa0488d 100644 --- a/ext/posix/posix.c +++ b/ext/posix/posix.c @@ -547,15 +547,15 @@ PHP_FUNCTION(posix_ttyname) efree(p); RETURN_FALSE; } - RETURN_STRING(p); + RETVAL_STRING(p); efree(p); #else if (NULL == (p = ttyname(fd))) { POSIX_G(last_error) = errno; RETURN_FALSE; } -#endif RETURN_STRING(p); +#endif } /* }}} */