From 7ddc80ea9216de344d7b8278554073226f5ae2c9 Mon Sep 17 00:00:00 2001 From: Jaime Casanova Date: Thu, 21 Oct 2010 14:49:26 -0500 Subject: [PATCH] I was having a segmentation fault because i was using a pointer to char but never indicated a size for the compiler to reserve... malloc() solves my problem --- repmgr.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/repmgr.c b/repmgr.c index 17670d65..47482531 100644 --- a/repmgr.c +++ b/repmgr.c @@ -207,7 +207,10 @@ main(int argc, char **argv) exit(1); if (config_file == NULL) + { + config_file = malloc(10 + sizeof(CONFIG_FILE)); sprintf(config_file, "./%s", CONFIG_FILE); + } if (dbname == NULL) {