enomem: log function name

xmppipe occasionally crashes with an "allocation failure" message. Log
the function name for debugging.
pull/1/head
Michael Santos 8 years ago
parent e96427bb36
commit 7d4672a99a

@ -52,7 +52,7 @@ xmppipe_strdup(const char *s)
buf = strdup(s);
if (buf == NULL)
err(3, "allocation failure");
err(3, "xmppipe_strdup");
return buf;
}
@ -67,7 +67,7 @@ xmppipe_malloc(size_t size)
buf = malloc(size);
if (buf == NULL)
err(3, "allocation failure");
err(3, "xmppipe_malloc");
return buf;
}
@ -79,7 +79,7 @@ xmppipe_calloc(size_t nmemb, size_t size)
buf = calloc(nmemb, size);
if (buf == NULL)
err(3, "allocation failure");
err(3, "xmppipe_calloc");
return buf;
}
@ -90,7 +90,7 @@ xmppipe_stanza_new(xmpp_ctx_t *ctx)
xmpp_stanza_t *s = xmpp_stanza_new(ctx);
if (s == NULL)
err(3, "allocation failure");
err(3, "xmppipe_stanza_new");
return s;
}
@ -100,14 +100,14 @@ xmppipe_stanza_set_attribute(xmpp_stanza_t * const stanza,
const char * const key, const char * const value)
{
if (xmpp_stanza_set_attribute(stanza, key, value) < 0)
err(3, "allocation failure");
err(3, "xmppipe_stanza_set_attribute");
}
void
xmppipe_stanza_set_id(xmpp_stanza_t * const stanza, const char * const id)
{
if (xmpp_stanza_set_id(stanza, id) < 0)
err(3, "allocation failure");
err(3, "xmppipe_stanza_set_id");
}
void
@ -117,7 +117,7 @@ xmppipe_stanza_set_name(xmpp_stanza_t *stanza, const char * const name)
case 0:
return;
case XMPP_EMEM:
err(3, "allocation failure");
err(3, "xmppipe_stanza_set_name");
case XMPP_EINVOP:
err(4, "invalid operation");
default:
@ -129,28 +129,28 @@ xmppipe_stanza_set_name(xmpp_stanza_t *stanza, const char * const name)
xmppipe_stanza_set_ns(xmpp_stanza_t * const stanza, const char * const ns)
{
if (xmpp_stanza_set_ns(stanza, ns) < 0)
err(3, "allocation failure");
err(3, "xmppipe_stanza_set_ns");
}
void
xmppipe_stanza_set_text(xmpp_stanza_t *stanza, const char * const text)
{
if (xmpp_stanza_set_text(stanza, text) < 0)
err(3, "allocation failure");
err(3, "xmppipe_stanza_set_text");
}
void
xmppipe_stanza_set_type(xmpp_stanza_t * const stanza, const char * const type)
{
if (xmpp_stanza_set_type(stanza, type) < 0)
err(3, "allocation failure");
err(3, "xmppipe_stanza_set_type");
}
void
xmppipe_stanza_add_child(xmpp_stanza_t * stanza, xmpp_stanza_t * child)
{
if (xmpp_stanza_add_child(stanza, child) < 0)
err(3, "allocation failure");
err(3, "xmppipe_stanza_add_child");
}
char *

Loading…
Cancel
Save