From: Sebastian Hammer Date: Tue, 5 Dec 1995 11:16:10 +0000 (+0000) Subject: Fixed malloc of 0. X-Git-Tag: YAZ.1.8~863 X-Git-Url: http://sru.miketaylor.org.uk/cgi-bin?a=commitdiff_plain;h=22539de88437f4812d17f8ab1d71db52f1da4c0e;p=yaz-moved-to-github.git Fixed malloc of 0. --- diff --git a/retrieval/d1_espec.c b/retrieval/d1_espec.c index 3c62d05..3fdbca6 100644 --- a/retrieval/d1_espec.c +++ b/retrieval/d1_espec.c @@ -4,7 +4,10 @@ * Sebastian Hammer, Adam Dickmeiss * * $Log: d1_espec.c,v $ - * Revision 1.3 1995-11-13 09:27:34 quinn + * Revision 1.4 1995-12-05 11:16:10 quinn + * Fixed malloc of 0. + * + * Revision 1.3 1995/11/13 09:27:34 quinn * Fiddling with the variant stuff. * * Revision 1.2 1995/11/01 16:34:56 quinn @@ -40,7 +43,10 @@ static Z_Variant *read_variant(int argc, char **argv, ODR o) var1.value = VAL_VAR1; r->globalVariantSetId = odr_oiddup(o, oid_getoidbyent(&var1)); - r->triples = odr_malloc(o, sizeof(Z_Triple*) * argc); + if (argc) + r->triples = odr_malloc(o, sizeof(Z_Triple*) * argc); + else + r->triples = 0; r->num_triples = argc; for (i = 0; i < argc; i++) {