summaryrefslogtreecommitdiff
path: root/src/lib/frct.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib/frct.c')
-rw-r--r--src/lib/frct.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/lib/frct.c b/src/lib/frct.c
index a1e792af..ff938aec 100644
--- a/src/lib/frct.c
+++ b/src/lib/frct.c
@@ -156,10 +156,19 @@ static int frct_rib_read(const char * path,
static int frct_rib_readdir(char *** buf)
{
*buf = malloc(sizeof(**buf));
+ if (*buf == NULL)
+ goto fail_malloc;
(*buf)[0] = strdup("frct");
+ if ((*buf)[0] == NULL)
+ goto fail_strdup;
return 1;
+
+ fail_strdup:
+ free(*buf);
+ fail_malloc:
+ return -ENOMEM;
}
static int frct_rib_getattr(const char * path,