mirror of
git://sourceware.org/git/glibc.git
synced 2024-11-27 03:41:23 +08:00
(__gconv_open): Set res to __GCONV_NOMEM is malloc fails.
This commit is contained in:
parent
7e48149628
commit
67aacae674
@ -223,7 +223,10 @@ __gconv_open (const char *toset, const char *fromset, __gconv_t *handle,
|
|||||||
newp = (struct __gconv_trans_data *)
|
newp = (struct __gconv_trans_data *)
|
||||||
malloc (sizeof (struct __gconv_trans_data));
|
malloc (sizeof (struct __gconv_trans_data));
|
||||||
if (newp == NULL)
|
if (newp == NULL)
|
||||||
|
{
|
||||||
|
res = __GCONV_NOMEM;
|
||||||
goto bail;
|
goto bail;
|
||||||
|
}
|
||||||
|
|
||||||
newp->__trans_fct = runp->trans_fct;
|
newp->__trans_fct = runp->trans_fct;
|
||||||
newp->__trans_context_fct = runp->trans_context_fct;
|
newp->__trans_context_fct = runp->trans_context_fct;
|
||||||
@ -251,7 +254,10 @@ __gconv_open (const char *toset, const char *fromset, __gconv_t *handle,
|
|||||||
|
|
||||||
result->__data[cnt].__outbuf = (char *) malloc (size);
|
result->__data[cnt].__outbuf = (char *) malloc (size);
|
||||||
if (result->__data[cnt].__outbuf == NULL)
|
if (result->__data[cnt].__outbuf == NULL)
|
||||||
|
{
|
||||||
|
res = __GCONV_NOMEM;
|
||||||
goto bail;
|
goto bail;
|
||||||
|
}
|
||||||
|
|
||||||
result->__data[cnt].__outbufend =
|
result->__data[cnt].__outbufend =
|
||||||
result->__data[cnt].__outbuf + size;
|
result->__data[cnt].__outbuf + size;
|
||||||
|
Loading…
Reference in New Issue
Block a user