~brenns10/funlisp

8032840a87519e3be27da23b1cbd86dbef040d1a — Stephen Brennan 3 years ago 74796a2
Add missing NULL check in hashtable get
1 files changed, 3 insertions(+), 0 deletions(-)

M src/hashtable.c
M src/hashtable.c => src/hashtable.c +3 -0
@@ 309,6 309,9 @@ void *ht_get(struct hashtable const *table, void *key)
void *ht_get_ptr(struct hashtable const *table, void *key)
{
  void **result = ht_get(table, &key);
  if (!result) {
    return NULL;
  }
  return *result;
}