diff options
-rw-r--r-- | src/check.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/check.c b/src/check.c index ac7cbd5..61218a7 100644 --- a/src/check.c +++ b/src/check.c @@ -96,12 +96,12 @@ distance(const char *old, const char *new) m = strlen(old); n = strlen(new); - distances = malloc(sizeof(int*) * (m + 1)); + distances = calloc(m + 1, sizeof(int*)); if (distances == NULL) return -1; for (i = 0; i <= m; i++) { - distances[i] = malloc(sizeof(int) * (n + 1)); + distances[i] = calloc(n + 1, sizeof(int)); if (distances[i] == NULL) goto allocfail; |