From de3584714625f4a7e6a8c6b6f9b82f2d6a9bb694 Mon Sep 17 00:00:00 2001 From: rlar Date: Wed, 27 Oct 2010 16:40:10 +0000 Subject: [PATCH] realloc does work, even with NULL argument --- ChangeLog | 5 +++++ src/spicelib/devices/asrc/asrcset.c | 2 +- src/xspice/mif/mifgetvalue.c | 2 +- 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index 41dd02fc2..0f7344fbe 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2010-10-27 Robert Larice + * src/spicelib/devices/asrc/asrcset.c , + * src/xspice/mif/mifgetvalue.c : + realloc does work, even with NULL argument + 2010-10-27 Robert Larice * src/spicelib/devices/bsim3soi/b4soitemp.c : use tmalloc instead of malloc diff --git a/src/spicelib/devices/asrc/asrcset.c b/src/spicelib/devices/asrc/asrcset.c index a2268aed9..7844f952a 100644 --- a/src/spicelib/devices/asrc/asrcset.c +++ b/src/spicelib/devices/asrc/asrcset.c @@ -34,7 +34,7 @@ ASRCsetup(SMPmatrix *matrix, GENmodel *inModel, CKTcircuit *ckt, int *states) for (here = model->ASRCinstances; here != NULL ; here=here->ASRCnextInstance) { - here->ASRCposptr = (double **)MALLOC(0); + here->ASRCposptr = NULL; j=0; /*strchr of the array holding ptrs to SMP */ v_first = 1; if( here->ASRCtype == ASRC_VOLTAGE){ diff --git a/src/xspice/mif/mifgetvalue.c b/src/xspice/mif/mifgetvalue.c index e665d292e..aedf969ae 100755 --- a/src/xspice/mif/mifgetvalue.c +++ b/src/xspice/mif/mifgetvalue.c @@ -120,7 +120,7 @@ MIFgetValue ( return(NULL); } val.v.numValue = 0; - val.v.vec.iVec = (int *) MALLOC(1); /* just so that realloc doesn't bomb */ + val.v.vec.iVec = NULL; }