We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent a9ce779 commit 968ca92Copy full SHA for 968ca92
1 file changed
src/napi5.c
@@ -135,7 +135,7 @@ static herr_t readStringAttribute(hid_t attr, char **data)
135
}
136
137
iRet = H5Aread(attr, atype, strings[0]);
138
- *data = malloc((sdim + 2) * thedims[0] * sizeof(char));
+ *data = calloc((sdim + 2) * thedims[0], sizeof(char));
139
for(i=0; i<thedims[0]; i++) {
140
if (i==0) {
141
strncpy(*data, strings[i], sdim);
0 commit comments