Patch from larry doolittle to make sure we don't realloc
authorEric Andersen <andersen@codepoet.org>
Mon, 11 Dec 2000 20:29:13 +0000 (20:29 -0000)
committerEric Andersen <andersen@codepoet.org>
Mon, 11 Dec 2000 20:29:13 +0000 (20:29 -0000)
a pointer that was not yet malloced mem.

logger.c
sysklogd/logger.c

index 669a2d6010091551641ce11afa0b311524c0908e..f5c776ddf76ca0981dfb5e4f6fcd9e2303efee5b 100644 (file)
--- a/logger.c
+++ b/logger.c
@@ -151,6 +151,7 @@ extern int logger_main(int argc, char **argv)
        } else {
                if (argc >= 1) {
                        int len = 1; /* for the '\0' */
+                       message=xcalloc(1, 1);
                        for (; *argv != NULL; argv++) {
                                len += strlen(*argv);
                                len += 1;  /* for the space between the args */
index 669a2d6010091551641ce11afa0b311524c0908e..f5c776ddf76ca0981dfb5e4f6fcd9e2303efee5b 100644 (file)
@@ -151,6 +151,7 @@ extern int logger_main(int argc, char **argv)
        } else {
                if (argc >= 1) {
                        int len = 1; /* for the '\0' */
+                       message=xcalloc(1, 1);
                        for (; *argv != NULL; argv++) {
                                len += strlen(*argv);
                                len += 1;  /* for the space between the args */