Don't fail if realloc(X, 0) returns NULL.
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@4344 ec53bebd-3082-4978-b11e-865c3cabbd6b
This commit is contained in:
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 1997 Kungliga Tekniska H<>gskolan
|
* Copyright (c) 1997, 1998 Kungliga Tekniska H<>gskolan
|
||||||
* (Royal Institute of Technology, Stockholm, Sweden).
|
* (Royal Institute of Technology, Stockholm, Sweden).
|
||||||
* All rights reserved.
|
* All rights reserved.
|
||||||
*
|
*
|
||||||
@@ -221,7 +221,7 @@ init_sockets(struct descr **desc)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
d = realloc(d, num * sizeof(*d));
|
d = realloc(d, num * sizeof(*d));
|
||||||
if (d == NULL)
|
if (d == NULL && num != 0)
|
||||||
krb5_errx(context, 1, "realloc(%u) failed", num * sizeof(*d));
|
krb5_errx(context, 1, "realloc(%u) failed", num * sizeof(*d));
|
||||||
*desc = d;
|
*desc = d;
|
||||||
return num;
|
return num;
|
||||||
|
Reference in New Issue
Block a user