Skip to content

Commit 1a92fa7

Browse files
authored
Use redisFreeCommand instead of free() function (#2351)
1 parent 218eb75 commit 1a92fa7

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

nosql_lib/redis/src/RedisConnection.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ class RedisConnection : public trantor::NonCopyable,
7474
static std::string getFormattedCommand(const std::string_view &command,
7575
va_list ap) noexcept(false)
7676
{
77-
char *cmd;
77+
char *cmd{nullptr};
7878
auto len = redisvFormatCommand(&cmd, command.data(), ap);
7979
if (len == -1)
8080
{
@@ -92,7 +92,7 @@ class RedisConnection : public trantor::NonCopyable,
9292
"Unknown format error");
9393
}
9494
std::string fullCommand{cmd, static_cast<size_t>(len)};
95-
free(cmd);
95+
redisFreeCommand(cmd);
9696
return fullCommand;
9797
}
9898

0 commit comments

Comments
 (0)