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 <serge@hallyn.com>
Cc: Alexey Tikhonov <atikhono@redhat.com>
This commit is contained in:
Serge Hallyn 2021-05-17 08:48:03 -05:00
parent f9831a4a1a
commit e34f49c196

View File

@ -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) {