Check return value from asprintf instead of string != NULL since it

undefined behavior on Linux. From Björn Sandell


git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@16216 ec53bebd-3082-4978-b11e-865c3cabbd6b
This commit is contained in:
Love Hörnquist Åstrand
2005-10-22 13:15:43 +00:00
parent f74a40ff85
commit 9dccedb6d3
3 changed files with 61 additions and 24 deletions

View File

@@ -97,8 +97,7 @@ add_missing_headers(POP *p, MsgInfoList *mp)
{
#if defined(UIDL) || defined(XOVER)
if (mp->msg_id == NULL) {
asprintf(&mp->msg_id, "no-message-id-%d", mp->number);
if(mp->msg_id == NULL) {
if (asprintf(&mp->msg_id, "no-message-id-%d", mp->number) == -1)
fclose (p->drop);
p->msg_count = 0;
return pop_msg (p,POP_FAILURE,