Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/usr.bin/xlint/lint1 Don't free memory; it is used later.
details: https://anonhg.NetBSD.org/src/rev/3f4f080f0426
branches: trunk
changeset: 795532:3f4f080f0426
user: christos <christos%NetBSD.org@localhost>
date: Thu Apr 17 16:29:26 2014 +0000
description:
Don't free memory; it is used later.
diffstat:
usr.bin/xlint/lint1/init.c | 25 ++++++++-----------------
1 files changed, 8 insertions(+), 17 deletions(-)
diffs (77 lines):
diff -r 094edf1a3666 -r 3f4f080f0426 usr.bin/xlint/lint1/init.c
--- a/usr.bin/xlint/lint1/init.c Thu Apr 17 16:22:48 2014 +0000
+++ b/usr.bin/xlint/lint1/init.c Thu Apr 17 16:29:26 2014 +0000
@@ -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 <sys/cdefs.h>
#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 <stdlib.h>
@@ -500,7 +500,7 @@
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 @@
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 @@
/* 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 @@
LERROR("mkinit()");
if (!typeok(INIT, 0, ln, tn))
- goto end;
+ return;
/*
* Store the tree memory. This is nessesary because otherwise
@@ -594,15 +594,6 @@
}
}
}
-
- 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();
}
Home |
Main Index |
Thread Index |
Old Index