symbol: Make symbol result optional
Signed-off-by: Ian Moffett <ian@mirocom.org>
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user