From 8a203517794654b53c32a6244247ad1d6a44cbae Mon Sep 17 00:00:00 2001 From: christos Date: Thu, 17 Apr 2014 16:29:26 +0000 Subject: [PATCH] Don't free memory; it is used later. --- usr.bin/xlint/lint1/init.c | 25 ++++++++----------------- 1 file changed, 8 insertions(+), 17 deletions(-) diff --git a/usr.bin/xlint/lint1/init.c b/usr.bin/xlint/lint1/init.c index 4c04989e665d..9c7450bbf644 100644 --- a/usr.bin/xlint/lint1/init.c +++ b/usr.bin/xlint/lint1/init.c @@ -1,4 +1,4 @@ -/* $NetBSD: init.c,v 1.24 2009/10/02 18:17:16 christos Exp $ */ +/* $NetBSD: init.c,v 1.25 2014/04/17 16:29:26 christos Exp $ */ /* * Copyright (c) 1994, 1995 Jochen Pohl @@ -37,7 +37,7 @@ #include #if defined(__RCSID) && !defined(lint) -__RCSID("$NetBSD: init.c,v 1.24 2009/10/02 18:17:16 christos Exp $"); +__RCSID("$NetBSD: init.c,v 1.25 2014/04/17 16:29:26 christos Exp $"); #endif #include @@ -500,7 +500,7 @@ mkinit(tnode_t *tn) DPRINTF(("mkinit(%s %s)\n", tyname(buf, sizeof(buf), tn->tn_type), prtnode(sbuf, sizeof(sbuf), tn))); if (initerr || tn == NULL) - goto end; + return; sc = initsym->s_scl; @@ -521,8 +521,8 @@ mkinit(tnode_t *tn) ln->tn_type = tduptyp(ln->tn_type); ln->tn_type->t_const = 0; tn = build(ASSIGN, ln, tn); - expr(tn, 0, 0, 1); - goto end; + expr(tn, 0, 0, 0); + return; } /* @@ -533,11 +533,11 @@ mkinit(tnode_t *tn) /* Initialisations by strings are done in strginit(). */ if (strginit(tn)) - goto end; + return; nextinit(0); if (initerr || tn == NULL) - goto end; + return; initstk->i_cnt--; DPRINTF(("mkinit() cnt=%d tn=%p\n", initstk->i_cnt, tn)); @@ -558,7 +558,7 @@ mkinit(tnode_t *tn) LERROR("mkinit()"); if (!typeok(INIT, 0, ln, tn)) - goto end; + return; /* * Store the tree memory. This is nessesary because otherwise @@ -594,15 +594,6 @@ mkinit(tnode_t *tn) } } } - - end: - /* - * We only free the block, if we are not a compound declaration - * We know that the only symbols that start with a digit are the - * ones we allocate with mktempsym() for compound declarations - */ - if (!isdigit((unsigned char)initsym->s_name[0])) - tfreeblk(); }