From: Rick L Bird Date: Sun, 17 Apr 2011 08:25:14 +0000 (-0400) Subject: As commented bad malloc'ing should be a panic refs #3 X-Git-Url: https://git.theari.com/?a=commitdiff_plain;h=a5f2e96ae60923892d2f9a8afe9c41ddf90df3da;p=cobramush.git As commented bad malloc'ing should be a panic refs #3 --- diff --git a/src/modules.c b/src/modules.c index ba63447..070ace5 100644 --- a/src/modules.c +++ b/src/modules.c @@ -26,9 +26,8 @@ struct module_entry_t *module_entry_add(char *name) { entry = (struct module_entry_t *) mush_malloc(sizeof(struct module_entry_t), "MODULE_ENTRY"); - if(!entry) { - return NULL; /* Should really panic here.. */ - } + if(!entry) + mush_panic("Could not allocate MODULE_ENTRY"); entry->name = mush_strdup(name, "MODULE_ENTRY.NAME"); entry->info = NULL;