From 9a22de8270fbb594cbdd23fe06a9e193ee01f17a Mon Sep 17 00:00:00 2001 From: Alex McHale Date: Tue, 13 Apr 2010 11:48:33 -0500 Subject: [PATCH] Fixed a tiny memory leak when loading the configuration file. --- redis.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/redis.c b/redis.c index e78f75aa6..bb54cce02 100644 --- a/redis.c +++ b/redis.c @@ -1693,15 +1693,12 @@ static void loadServerConfig(char *filename) { char buf[REDIS_CONFIGLINE_MAX+1], *err = NULL; int linenum = 0; sds line = NULL; - char *errormsg = "Fatal error, can't open config file '%s'"; - char *errorbuf = zmalloc(sizeof(char)*(strlen(errormsg)+strlen(filename))); - sprintf(errorbuf, errormsg, filename); if (filename[0] == '-' && filename[1] == '\0') fp = stdin; else { if ((fp = fopen(filename,"r")) == NULL) { - redisLog(REDIS_WARNING, errorbuf); + redisLog(REDIS_WARNING, "Fatal error, can't open config file '%s'", filename); exit(1); } }