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

@@ -58,10 +58,16 @@ wind_stringprep(const uint32_t *in, size_t in_len,
wind_profile_flags flags)
{
size_t tmp_len = in_len * 3;
uint32_t *tmp = malloc(tmp_len * sizeof(uint32_t));
uint32_t *tmp;
int ret;
size_t olen;
if (in_len == 0) {
*out_len = 0;
return 0;
}
tmp = malloc(tmp_len * sizeof(uint32_t));
if (tmp == NULL)
return ENOMEM;