diff options
author | Florian Obser <florian@cvs.openbsd.org> | 2019-11-09 08:06:39 +0000 |
---|---|---|
committer | Florian Obser <florian@cvs.openbsd.org> | 2019-11-09 08:06:39 +0000 |
commit | 33367f40521b5d3e020e309ef4dc95a045fbb23e (patch) | |
tree | 4b798d5acdc7aadaac3ed5953ae62c45383745f0 | |
parent | e96892510038fd978827b79ab7fdcf5bf152bafd (diff) |
failure to allocate memory is not an XXX
-rw-r--r-- | sbin/unwind/resolver.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/sbin/unwind/resolver.c b/sbin/unwind/resolver.c index 550b9afded9..f5a2b623547 100644 --- a/sbin/unwind/resolver.c +++ b/sbin/unwind/resolver.c @@ -1,4 +1,4 @@ -/* $OpenBSD: resolver.c,v 1.53 2019/11/06 16:51:11 florian Exp $ */ +/* $OpenBSD: resolver.c,v 1.54 2019/11/09 08:06:38 florian Exp $ */ /* * Copyright (c) 2018 Florian Obser <florian@openbsd.org> @@ -445,7 +445,11 @@ resolver_dispatch_frontend(int fd, short event, void *bula) if (IMSG_DATA_SIZE(imsg) != sizeof(*query_imsg)) fatalx("%s: IMSG_QUERY wrong length: %lu", __func__, IMSG_DATA_SIZE(imsg)); - query_imsg = malloc(sizeof(*query_imsg)); /* XXX */ + if ((query_imsg = malloc(sizeof(*query_imsg))) == + NULL) { + log_warn("cannot allocate query"); + break; + } memcpy(query_imsg, imsg.data, sizeof(*query_imsg)); log_debug("%s: IMSG_QUERY[%llu], qname: %s, t: %d, " |