summaryrefslogtreecommitdiff
path: root/src/tools/asm
diff options
context:
space:
mode:
Diffstat (limited to 'src/tools/asm')
-rw-r--r--src/tools/asm/q3asm.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/tools/asm/q3asm.c b/src/tools/asm/q3asm.c
index c42b9ac5..6c4c9195 100644
--- a/src/tools/asm/q3asm.c
+++ b/src/tools/asm/q3asm.c
@@ -387,8 +387,12 @@ static void sort_symbols ()
symbol_t *s;
symbol_t **symlist;
+ if(!symbols)
+ return;
+
//crumb("sort_symbols: Constructing symlist array\n");
for (elems = 0, s = symbols; s; s = s->next, elems++) /* nop */ ;
+
symlist = malloc(elems * sizeof(symbol_t*));
for (i = 0, s = symbols; s; s = s->next, i++)
{