[multiple] add assert after malloc in two spots

add missing assert after malloc in two spots to detect malloc failure
(unlikely)
master
Glenn Strauss 1 year ago
parent 7edb1956f3
commit ac9c9935a2

@ -1077,6 +1077,7 @@ static int http_read_directory(handler_ctx * const p) {
}
dirls_entry_t * const tmp = list->ent[list->used++] =
(dirls_entry_t*) malloc(sizeof(dirls_entry_t) + 1 + dsz);
force_assert(tmp);
tmp->mtime = st.st_mtime;
tmp->size = st.st_size;
tmp->namelen = dsz;

@ -68,6 +68,7 @@ static void* mod_mysql_vhost_connection_data(request_st * const r, void *p_d)
if (c) return c;
c = calloc(1, sizeof(*c));
force_assert(c);
c->server_name = buffer_init();
c->document_root = buffer_init();

Loading…
Cancel
Save