Skip to content

Commit

Permalink
xgetXXbyYY: Handle DUP_FUNCTION failure
Browse files Browse the repository at this point in the history
A failure of DUP_FUNCTION is already handled for non-reentrant
function wrapper. Perform the check for reentrant version as well.

Signed-off-by: Samanta Navarro <[email protected]>
  • Loading branch information
ferivoz authored and hallyn committed May 26, 2023
1 parent a80b792 commit e73a219
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions libmisc/xgetXXbyYY.c
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,12 @@
/* Build a result structure that can be freed by
* the shadow *_free functions. */
LOOKUP_TYPE *ret_result = DUP_FUNCTION(result);
if (NULL == result) {
fprintf (log_get_logfd(),
_("%s: out of memory\n"),
"x" STRINGIZE(FUNCTION_NAME));
exit (13);
}
free(buffer);
free(result);
return ret_result;
Expand Down

0 comments on commit e73a219

Please sign in to comment.