Check for malloc(0) to make AIX happy

Prompted by [HEIMDAL-646] by Anton Lundin
This commit is contained in:
Love Hornquist Astrand
2009-09-24 07:32:35 -07:00
parent 98f2421134
commit 9bace01559
5 changed files with 17 additions and 4 deletions

View File

@@ -73,7 +73,9 @@ lookup(const char *name)
size_t norm_len = u_len * 2;
uint32_t *norm = malloc(norm_len * sizeof(uint32_t));
if (u == NULL || norm == NULL)
if (u == NULL && u_len != 0)
errx(1, "malloc failed");
if (norm == NULL && norm_len != 0)
errx(1, "malloc failed");
ret = wind_utf8ucs4(name, u, &u_len);