diff options
Diffstat (limited to 'lib/libc/gen/getgrent.c')
-rw-r--r-- | lib/libc/gen/getgrent.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/libc/gen/getgrent.c b/lib/libc/gen/getgrent.c index 4ba24ae..1f4d7e9 100644 --- a/lib/libc/gen/getgrent.c +++ b/lib/libc/gen/getgrent.c @@ -1173,8 +1173,10 @@ nis_group(void *retval, void *mdata, va_list ap) * terminator, alignment padding, and one (char *) * pointer for the member list terminator. */ - if (resultlen >= bufsize - _ALIGNBYTES - sizeof(char *)) + if (resultlen >= bufsize - _ALIGNBYTES - sizeof(char *)) { + free(result); goto erange; + } memcpy(buffer, result, resultlen); buffer[resultlen] = '\0'; free(result); |