--- psiconv/trunk/lib/psiconv/generate_layout.c 2004/02/25 20:57:10 231 +++ psiconv/trunk/lib/psiconv/generate_layout.c 2005/11/15 15:52:34 270 @@ -1,6 +1,6 @@ /* generate_layout.c - Part of psiconv, a PSION 5 file formats converter - Copyright (c) 2000-2004 Frodo Looijaard + Copyright (c) 2000-2005 Frodo Looijaard This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -138,6 +138,7 @@ } if (!(extra_buf = psiconv_buffer_new())) { + psiconv_error(config,lev+1,0,"Out of memory error"); res = -PSICONV_E_NOMEM; goto ERROR1; } @@ -155,7 +156,10 @@ if ((res = psiconv_write_u8(config,buf,lev+1,psiconv_buffer_length(extra_buf)))) goto ERROR2; - res = psiconv_buffer_concat(buf,extra_buf); + if ((res = psiconv_buffer_concat(buf,extra_buf))) { + psiconv_error(config,lev+1,0,"Out of memory error"); + goto ERROR2; + } ERROR2: psiconv_buffer_free(extra_buf); @@ -399,7 +403,7 @@ goto ERROR2; for (i = 0; i < psiconv_list_length(value->tabs->extras); i++) { if (!(tab = psiconv_list_get(value->tabs->extras,i))) { - psiconv_error(config,lev+1,0,"Massive memory corruption"); + psiconv_error(config,lev+1,0,"Data structure corruption"); res = -PSICONV_E_NOMEM; goto ERROR2; } @@ -413,7 +417,10 @@ if ((res = psiconv_write_u32(config,buf,lev+1,psiconv_buffer_length(extra_buf)))) goto ERROR2; - res = psiconv_buffer_concat(buf,extra_buf); + if ((res = psiconv_buffer_concat(buf,extra_buf))) { + psiconv_error(config,lev+1,0,"Out of memory error"); + goto ERROR2; + } ERROR2: psiconv_buffer_free(extra_buf);