Skip to content

Commit

Permalink
11687 isaexec() leaks memory if realloc fails
Browse files Browse the repository at this point in the history
Reviewed by: Yuri Pankov <yuri.pankov@nexenta.com>
Reviewed by: Robert Mustacchi <rm@fingolfin.org>
Approved by: Dan McDonald <danmcd@joyent.com>
  • Loading branch information
citrus-it committed Sep 20, 2019
1 parent 2b77347 commit d1704f8
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions usr/src/lib/libc/port/gen/isaexec.c
Expand Up @@ -24,7 +24,9 @@
* Use is subject to license terms.
*/

#pragma ident "%Z%%M% %I% %E% SMI"
/*
* Copyright 2019 OmniOS Community Edition (OmniOSce) Association.
*/

#pragma weak _isaexec = isaexec

Expand Down Expand Up @@ -67,9 +69,10 @@ isaexec(const char *execname, char *const *argv, char *const *envp)
}
if (ret > isalen) {
isalen = ret;
isalist = realloc(isalist, isalen);
} else
isalist = reallocf(isalist, isalen);
} else {
break;
}
} while (isalist != NULL);

if (isalist == NULL) {
Expand Down

0 comments on commit d1704f8

Please sign in to comment.