Bug fix: On Solaris: False out-of-memory errors when writing images.

This commit is contained in:
Thomas Schmitt 2011-08-19 12:40:45 +02:00
parent aeb5258ae2
commit ce19db5e19
1 changed files with 4 additions and 4 deletions

View File

@ -383,7 +383,7 @@ int str2ascii(const char *icharset, const char *input, char **output)
{ {
int result; int result;
wchar_t *wsrc_ = NULL; wchar_t *wsrc_ = NULL;
char *ret; char *ret = NULL;
char *ret_ = NULL; char *ret_ = NULL;
char *src; char *src;
struct iso_iconv_handle conv; struct iso_iconv_handle conv;
@ -451,7 +451,7 @@ int str2ascii(const char *icharset, const char *input, char **output)
loop_limit = inbytes + 3; loop_limit = inbytes + 3;
outbytes = (inbytes + 1) * sizeof(uint16_t); outbytes = (inbytes + 1) * sizeof(uint16_t);
ret_ = malloc(outbytes); ret_ = malloc(outbytes);
if (ret == NULL) if (ret_ == NULL)
return ISO_OUT_OF_MEM; return ISO_OUT_OF_MEM;
ret = ret_; ret = ret_;
} }
@ -547,7 +547,7 @@ int str2ucs(const char *icharset, const char *input, uint16_t **output)
int result; int result;
wchar_t *wsrc_ = NULL; wchar_t *wsrc_ = NULL;
char *src; char *src;
char *ret; char *ret = NULL;
char *ret_ = NULL; char *ret_ = NULL;
struct iso_iconv_handle conv; struct iso_iconv_handle conv;
int conv_ret = 0; int conv_ret = 0;
@ -610,7 +610,7 @@ int str2ucs(const char *icharset, const char *input, uint16_t **output)
loop_limit = inbytes + 3; loop_limit = inbytes + 3;
outbytes = (inbytes + 1) * sizeof(uint16_t); outbytes = (inbytes + 1) * sizeof(uint16_t);
ret_ = malloc(outbytes); ret_ = malloc(outbytes);
if (ret == NULL) if (ret_ == NULL)
return ISO_OUT_OF_MEM; return ISO_OUT_OF_MEM;
ret = ret_; ret = ret_;
} }