Commit 1b392eb7 authored by Mareq's avatar Mareq Committed by Matt Stancliff
Browse files

Add API to free hiredis (char *) formattings

[Cleaned up:
  - name of function: freeRedis... -> redisFree...
  - return value of function (free doesn't return anything)
  - parameter type for function.
    - we don't need to free a char**, the char** is just
    for returning from the assignment functoin.]

Closes #250
parent 85c6bfb0
...@@ -1027,6 +1027,10 @@ int redisFormatCommandArgv(char **target, int argc, const char **argv, const siz ...@@ -1027,6 +1027,10 @@ int redisFormatCommandArgv(char **target, int argc, const char **argv, const siz
return totlen; return totlen;
} }
void redisFreeCommand(char *cmd) {
free(cmd);
}
void __redisSetError(redisContext *c, int type, const char *str) { void __redisSetError(redisContext *c, int type, const char *str) {
size_t len; size_t len;
......
...@@ -170,6 +170,7 @@ int redisvFormatCommand(char **target, const char *format, va_list ap); ...@@ -170,6 +170,7 @@ int redisvFormatCommand(char **target, const char *format, va_list ap);
int redisFormatCommand(char **target, const char *format, ...); int redisFormatCommand(char **target, const char *format, ...);
int redisFormatCommandArgv(char **target, int argc, const char **argv, const size_t *argvlen); 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); int redisFormatSdsCommandArgv(sds *target, int argc, const char ** argv, const size_t *argvlen);
void redisFreeCommand(char *cmd);
/* Context for a connection to Redis */ /* Context for a connection to Redis */
typedef struct redisContext { typedef struct redisContext {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment