diff options
Diffstat (limited to 'iconv/gconv_open.c')
-rw-r--r-- | iconv/gconv_open.c | 26 |
1 files changed, 13 insertions, 13 deletions
diff --git a/iconv/gconv_open.c b/iconv/gconv_open.c index 0e789df896..343cb70773 100644 --- a/iconv/gconv_open.c +++ b/iconv/gconv_open.c @@ -69,19 +69,19 @@ __gconv_open (const char *toset, const char *fromset, gconv_t *handle) if (res != GCONV_OK) break; } - else - if (!data[cnt].is_last) - { - data[cnt].outbufsize = GCONV_DEFAULT_BUFSIZE; - data[cnt].outbuf = - (char *) malloc (data[cnt].outbufsize); - if (data[cnt].outbuf == NULL) - { - res = GCONV_NOMEM; - break; - } - data[cnt].outbufavail = 0; - } + + if (!data[cnt].is_last && data[cnt].outbuf == NULL) + { + data[cnt].outbufsize = GCONV_DEFAULT_BUFSIZE; + data[cnt].outbuf = + (char *) malloc (data[cnt].outbufsize); + if (data[cnt].outbuf == NULL) + { + res = GCONV_NOMEM; + break; + } + data[cnt].outbufavail = 0; + } } } } |