lc/def/lcDefConv: Use Xcalloc to avoid use of uninitialized memory

Fixed by zero'ing conv on allocation with Xcalloc. Then
close_converter works properly.

Using uninitialized value "conv->state" in call to function "close_converter"

Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Reviewed-by: Erkki Seppälä <erkki.seppala@vincit.fi>
Signed-off-by: Ander Conselvan de Oliveira <ander.conselvan-de-oliveira@nokia.com>
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
This commit is contained in:
Ander Conselvan de Oliveira 2011-01-31 14:02:13 +02:00 committed by Alan Coopersmith
parent 03f81ad8fb
commit e2566e43b0
2 changed files with 2 additions and 2 deletions

View file

@ -577,7 +577,7 @@ create_conv(
XlcConv conv;
State state;
conv = (XlcConv) Xmalloc(sizeof(XlcConvRec));
conv = (XlcConv) Xcalloc(1, sizeof(XlcConvRec));
if (conv == NULL)
return (XlcConv) NULL;

View file

@ -2650,7 +2650,7 @@ create_conv(
XlcConv conv;
State state;
conv = (XlcConv) Xmalloc(sizeof(XlcConvRec));
conv = (XlcConv) Xcalloc(1, sizeof(XlcConvRec));
if (conv == NULL)
return (XlcConv) NULL;