--- psiconv/trunk/lib/psiconv/generate_common.c 2000/12/24 17:26:24 75 +++ psiconv/trunk/lib/psiconv/generate_common.c 2000/12/25 00:26:53 76 @@ -51,27 +51,19 @@ return -PSICONV_E_GENERATE; } - if (!(entry = malloc(sizeof(*entry)))) - return -PSICONV_E_NOMEM; - - if ((res = psiconv_write_u8(buf,2 * sizeof(psiconv_u32) * - psiconv_list_length(value)))) - goto ERROR; + if ((res = psiconv_write_u8(buf,2 * psiconv_list_length(value)))) + return res; for (i = 0; i < psiconv_list_length(value); i++) { if (!(entry = psiconv_list_get(value,i))) { psiconv_warn(0,psiconv_list_length(buf),"Massive memory corruption"); - res = -PSICONV_E_NOMEM; - goto ERROR; + return -PSICONV_E_NOMEM; } if ((res = psiconv_write_u32(buf,entry->id))) - goto ERROR; + return res; if ((res = psiconv_write_u32(buf,entry->offset))) - goto ERROR; + return res; } - res = -PSICONV_E_OK; -ERROR: - free(entry); - return res; + return -PSICONV_E_OK; } int psiconv_write_application_id_section(psiconv_buffer buf,psiconv_u32 id,