Browse Source

segmentlib: malloc -> calloc

Markus Metz 6 năm trước cách đây
mục cha
commit
bdb44f10b3
1 tập tin đã thay đổi với 1 bổ sung1 xóa
  1. 1 1
      lib/segment/open.c

+ 1 - 1
lib/segment/open.c

@@ -60,7 +60,7 @@ Segment_open(SEGMENT *SEG, char *fname, off_t nrows, off_t ncols,
 	SEG->ncols = ncols;
 	SEG->len = len;
 	SEG->nseg = nseg;
-	SEG->cache = G_malloc(sizeof(char) * SEG->nrows * SEG->ncols * SEG->len);
+	SEG->cache = G_calloc(sizeof(char) * SEG->nrows * SEG->ncols, SEG->len);
 	SEG->scb = NULL;
 	SEG->open = 1;