diff --git a/hiredis.c b/hiredis.c index be67658..34198fc 100644 --- a/hiredis.c +++ b/hiredis.c @@ -1027,6 +1027,10 @@ int redisFormatCommandArgv(char **target, int argc, const char **argv, const siz return totlen; } +void redisFreeCommand(char *cmd) { + free(cmd); +} + void __redisSetError(redisContext *c, int type, const char *str) { size_t len; diff --git a/hiredis.h b/hiredis.h index 8e8aa03..c9f4a00 100644 --- a/hiredis.h +++ b/hiredis.h @@ -170,6 +170,7 @@ int redisvFormatCommand(char **target, const char *format, va_list ap); int redisFormatCommand(char **target, const char *format, ...); int redisFormatCommandArgv(char **target, int argc, const char **argv, const size_t *argvlen); int redisFormatSdsCommandArgv(sds *target, int argc, const char ** argv, const size_t *argvlen); +void redisFreeCommand(char *cmd); /* Context for a connection to Redis */ typedef struct redisContext {