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

@@ -101,7 +101,7 @@ test(char *buf)
norm_len = MAX_LENGTH_CANON;
tmp = malloc(norm_len * sizeof(size_t));
if (tmp == NULL)
if (tmp == NULL && norm_len != 0)
err(1, "malloc");
ret = _wind_stringprep_normalize(in, in_len, tmp, &norm_len);
if (ret) {