Menu

#4 incorrect allocation size calculation

open
nobody
None
5
2010-12-08
2010-12-08
No

Double pointers to realtype are used throughout the code, meanwhile sizeof(realtype) is used to allocate first dimension instead of sizeof(realtype*). Here is an incorrect example from read_alloc.c :

DS->TSD_Riv[i].TS = (realtype **)malloc((DS->TSD_Riv[i].length)*sizeof(realtype))

Discussion


Log in to post a comment.