On Wed, Feb 15, 2023 at 03:11:40PM +0100, Laszlo Ersek wrote:
Correctly report "asprintf" in the error message when
asprintf() fails.
Signed-off-by: Laszlo Ersek <lersek(a)redhat.com>
---
generator/states-connect-socket-activation.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/generator/states-connect-socket-activation.c
b/generator/states-connect-socket-activation.c
index 3b621b8be44f..c46a0bf5c0a3 100644
--- a/generator/states-connect-socket-activation.c
+++ b/generator/states-connect-socket-activation.c
@@ -127,7 +127,7 @@ CONNECT_SA.START:
if (asprintf (&h->sact_sockpath, "%s/sock", h->sact_tmpdir) == -1)
{
SET_NEXT_STATE (%.DEAD);
- set_error (errno, "strdup");
+ set_error (errno, "asprintf");
At the end of the day, "malloc" would work too (we have several places
where we aren't precise on WHAT allocation failed, but where it's
obvious from the accompanying ENOMEM strerror() message that it was an
allocation failure). But when it's easy to be precise, go for it.
Reviewed-by: Eric Blake <eblake(a)redhat.com>
--
Eric Blake, Principal Software Engineer
Red Hat, Inc. +1-919-301-3266
Virtualization:
qemu.org |
libvirt.org