Mercurial > hg > sidinfo
comparison sidlib.c @ 99:29a080678091
Use th_calloc() here.
author | Matti Hamalainen <ccr@tnsp.org> |
---|---|
date | Sun, 14 Feb 2016 20:38:09 +0200 |
parents | d9f38d657433 |
children | be62e4abe3a9 |
comparison
equal
deleted
inserted
replaced
98:d9f38d657433 | 99:29a080678091 |
---|---|
317 | 317 |
318 // Allocate memory for lengths | 318 // Allocate memory for lengths |
319 if (node->nlengths == 0) | 319 if (node->nlengths == 0) |
320 goto error; | 320 goto error; |
321 | 321 |
322 node->lengths = (int *) th_malloc0(node->nlengths * sizeof(int)); | 322 node->lengths = (int *) th_calloc(node->nlengths, sizeof(int)); |
323 if (node->lengths == NULL) | 323 if (node->lengths == NULL) |
324 { | 324 { |
325 th_io_error(ctx, THERR_MALLOC, | 325 th_io_error(ctx, THERR_MALLOC, |
326 "Could not allocate memory for node.\n"); | 326 "Could not allocate memory for node.\n"); |
327 goto error; | 327 goto error; |