Skip to content
This repository has been archived by the owner on Mar 20, 2023. It is now read-only.

Commit

Permalink
Memb_list for pattern.mod should be calloc'd for zero-initialisation
Browse files Browse the repository at this point in the history
  • Loading branch information
pramodk committed Apr 21, 2022
1 parent 5233b6e commit 89baf7b
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions coreneuron/mechanism/patternstim.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ size_t read_raster_file(const char* fname, double** tvec, int** gidvec, double t

// see nrn_setup.cpp:read_phase2 for how it creates NrnThreadMembList instances.
static NrnThreadMembList* alloc_nrn_thread_memb(int type) {
NrnThreadMembList* tml = (NrnThreadMembList*) emalloc(sizeof(NrnThreadMembList));
NrnThreadMembList* tml = (NrnThreadMembList*) ecalloc(1, sizeof(NrnThreadMembList));
tml->dependencies = nullptr;
tml->ndependencies = 0;
tml->index = type;
Expand All @@ -149,7 +149,7 @@ static NrnThreadMembList* alloc_nrn_thread_memb(int type) {
int psize = corenrn.get_prop_param_size()[type];
int dsize = corenrn.get_prop_dparam_size()[type];
int layout = corenrn.get_mech_data_layout()[type];
tml->ml = (Memb_list*) emalloc(sizeof(Memb_list));
tml->ml = (Memb_list*) ecalloc(1, sizeof(Memb_list));
tml->ml->nodecount = 1;
tml->ml->_nodecount_padded = tml->ml->nodecount;
tml->ml->nodeindices = nullptr;
Expand Down
2 changes: 1 addition & 1 deletion external/mod2c
Submodule mod2c updated 1 files
+11 −10 src/mod2c_core/noccout.c

0 comments on commit 89baf7b

Please sign in to comment.