Callers already check error return value, so actually return one in case
of failure.
Signed-off-by: Tobias Stoeckmann <tobias@stoeckmann.org>
Link: https://github.com/kmod-project/kmod/pull/130
Signed-off-by: Lucas De Marchi <lucas.de.marchi@gmail.com>
{
struct index_node *node;
- node = NOFAIL(calloc(1, sizeof(struct index_node)));
- node->prefix = NOFAIL(strdup(""));
+ node = calloc(1, sizeof(struct index_node));
+ if (node == NULL)
+ return NULL;
+
+ node->prefix = strdup("");
+ if (node->prefix == NULL) {
+ free(node);
+ return NULL;
+ }
+
node->first = INDEX_CHILDMAX;
return node;