Change-Id: I3cf61033c7282d5d89c794e1e25cd4f1988be6e7
const char *full_path = NULL;
name = scanctx_take_string(ctx);
+ if(!name)
+ return NULL;
+
if((name[0] != FILE_SEPARATOR[0]) && ctx->config->include_dir)
{
full_path = scanctx_filename(ctx, ctx->config->include_dir, name);
+ if(!full_path)
+ return NULL;
free((void*)name);
}
else
{
const char *basedir = dirname ? dirname : ctx->basedir;
char *full_file = (char *)malloc(strlen(basedir) + strlen(filename) + 2);
+ if(!full_file)
+ return NULL;
strcpy(full_file, basedir);
strcat(full_file, FILE_SEPARATOR);