symbol: Make symbol result optional

Signed-off-by: Ian Moffett <ian@mirocom.org>
This commit is contained in:
2026-02-15 14:19:24 -05:00
parent 49169dda1c
commit c1a9413ef3

View File

@@ -66,10 +66,6 @@ symbol_new(struct symbol_table *table, const char *name, symtype_t type,
return -1;
}
if (res == NULL) {
return -1;
}
if ((symbol = malloc(sizeof(*symbol))) == NULL) {
return -1;
}
@@ -82,5 +78,10 @@ symbol_new(struct symbol_table *table, const char *name, symtype_t type,
/* Add symbol to symbol table */
++table->symbol_count;
TAILQ_INSERT_TAIL(&table->entries, symbol, link);
if (res != NULL) {
*res = symbol;
}
return 0;
}