Skip to content

Commit c63b476

Browse files
author
ddp
committed
Another instance of an unchecked malloc.
1 parent 69cc19e commit c63b476

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/analysisd/lists_list.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -152,6 +152,9 @@ static int OS_DBSearchKeyValue(ListRule *lrule, char *key)
152152
vpos = cdb_datapos(&lrule->db->cdb);
153153
vlen = cdb_datalen(&lrule->db->cdb);
154154
val = (char *) malloc(vlen);
155+
if(val == NULL) {
156+
return(0);
157+
}
155158
cdb_read(&lrule->db->cdb, val, vlen, vpos);
156159
result = OSMatch_Execute(val, vlen, lrule->matcher);
157160
free(val);

0 commit comments

Comments
 (0)