Fix a null pointer dereference in compile_rule(compiledict.c). [Coverity]

This commit is contained in:
Reece H. Dunn
2016-01-22 20:22:24 +00:00
parent a9adf136c6
commit 5673065168
+2 -2
View File
@@ -1141,8 +1141,8 @@ static char *compile_rule(char *input)
len += (strlen(rule_post)+1);
}
output[len++] = 0;
prule = (char *)malloc(len);
memcpy(prule, output, len);
if ((prule = (char *)malloc(len)) != NULL)
memcpy(prule, output, len);
return prule;
}