Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Fixed a tiny memory leak when loading the configuration file.

  • Loading branch information...
commit 9a22de8270fbb594cbdd23fe06a9e193ee01f17a 1 parent b60bace
@alexmchale alexmchale authored
Showing with 1 addition and 4 deletions.
  1. +1 −4 redis.c
View
5 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);
}
}
Please sign in to comment.
Something went wrong with that request. Please try again.