From dd5d033bbd445fd7cebf168ed106b95288235c90 Mon Sep 17 00:00:00 2001 From: Assar Westerlund Date: Mon, 14 Jul 1997 11:39:17 +0000 Subject: [PATCH] don't worry about strdup, it's defined by roken git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@2274 ec53bebd-3082-4978-b11e-865c3cabbd6b --- lib/asn1/lex.l | 4 ---- lib/asn1/parse.y | 10 ++++++---- 2 files changed, 6 insertions(+), 8 deletions(-) diff --git a/lib/asn1/lex.l b/lib/asn1/lex.l index cb9dd4d42..4397e1bbb 100644 --- a/lib/asn1/lex.l +++ b/lib/asn1/lex.l @@ -11,10 +11,6 @@ #include "symbol.h" #include "parse.h" -#ifndef HAVE_STRDUP -char *strdup(char *); -#endif - void error_message(char *, ...); static unsigned lineno = 1; diff --git a/lib/asn1/parse.y b/lib/asn1/parse.y index 19cb3cd94..b4b468c10 100644 --- a/lib/asn1/parse.y +++ b/lib/asn1/parse.y @@ -11,14 +11,12 @@ #include "lex.h" #include "asn1_locl.h" +RCSID("$Id$"); + static Type *new_type (Typetype t); void yyerror (char *); int yylex(); -#ifndef HAVE_STRDUP -char *strdup(char *); -#endif - static void append (Member *l, Member *r); %} @@ -170,6 +168,10 @@ static Type * new_type (Typetype tt) { Type *t = malloc(sizeof(*t)); + if (t == NULL) { + error_message ("out of memory in malloc(%u)", sizeof(*t)); + exit (1); + } t->type = tt; t->application = 0; t->members = NULL;