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