cron: fix the cron_multi_set memory allocation - fixes #2273

This commit is contained in:
Jaroslav Kysela 2014-09-08 18:04:19 +02:00
parent ba01c1000a
commit 4963d4c94d

View file

@ -176,7 +176,7 @@ cron_multi_set ( const char *str )
if (line[0] != '#')
if (!cron_set(&cron, line)) {
count++;
cm2 = realloc(cm, sizeof(cm) + sizeof(cron) * count);
cm2 = realloc(cm, sizeof(*cm) + sizeof(cron) * count);
if (cm2 == NULL) {
free(cm);
return NULL;