Merge pull request #341 from hallyn/2021-05-17/fail
libsubid_init: return false if out of memory
This commit is contained in:
commit
c6cab4a7ba
@ -46,10 +46,12 @@ bool libsubid_init(const char *progname, FILE * logfd)
|
|||||||
{
|
{
|
||||||
if (progname) {
|
if (progname) {
|
||||||
progname = strdup(progname);
|
progname = strdup(progname);
|
||||||
if (progname)
|
if (progname) {
|
||||||
Prog = progname;
|
Prog = progname;
|
||||||
else
|
} else {
|
||||||
fprintf(stderr, "Out of memory");
|
fprintf(stderr, "Out of memory");
|
||||||
|
return false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (logfd) {
|
if (logfd) {
|
||||||
|
Loading…
Reference in New Issue
Block a user