Browse Source

[multiple] add assert after malloc in two spots

add missing assert after malloc in two spots to detect malloc failure
(unlikely)
master
Glenn Strauss 3 months ago
parent
commit
ac9c9935a2
  1. 1
      src/mod_dirlisting.c
  2. 1
      src/mod_mysql_vhost.c

1
src/mod_dirlisting.c

@ -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;

1
src/mod_mysql_vhost.c

@ -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