From: Serge Hallyn Date: Mon, 17 May 2021 13:48:03 +0000 (-0500) Subject: libsubid_init: return false if out of memory X-Git-Tag: v4.9~23^2 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=refs%2Fpull%2F341%2Fhead;p=thirdparty%2Fshadow.git libsubid_init: return false if out of memory The rest of the run isn't likely to get much better, is it? Thanks to Alexey for pointing this out. Signed-off-by: Serge Hallyn Cc: Alexey Tikhonov --- diff --git a/libsubid/api.c b/libsubid/api.c index 8ca098590..8618e5005 100644 --- a/libsubid/api.c +++ b/libsubid/api.c @@ -46,10 +46,12 @@ bool libsubid_init(const char *progname, FILE * logfd) { if (progname) { progname = strdup(progname); - if (progname) + if (progname) { Prog = progname; - else + } else { fprintf(stderr, "Out of memory"); + return false; + } } if (logfd) {