From e3d1580d76ce35bc76b0bcff0fdb3298a06f4932 Mon Sep 17 00:00:00 2001 From: Jaime Casanova Date: Thu, 21 Oct 2010 17:58:17 -0500 Subject: [PATCH] In repmgrd there was the same problem that cause the segfault --- repmgr.c | 2 +- repmgrd.c | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/repmgr.c b/repmgr.c index 47482531..d1ff8f1b 100644 --- a/repmgr.c +++ b/repmgr.c @@ -208,7 +208,7 @@ main(int argc, char **argv) if (config_file == NULL) { - config_file = malloc(10 + sizeof(CONFIG_FILE)); + config_file = malloc(5 + sizeof(CONFIG_FILE)); sprintf(config_file, "./%s", CONFIG_FILE); } diff --git a/repmgrd.c b/repmgrd.c index 55b00d51..288b31c4 100644 --- a/repmgrd.c +++ b/repmgrd.c @@ -118,7 +118,10 @@ main(int argc, char **argv) setup_cancel_handler(); if (config_file == NULL) + { + config_file = malloc(5 + sizeof(CONFIG_FILE)); sprintf(config_file, "./%s", CONFIG_FILE); + } /* * Read the configuration file: repmgr.conf