Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
ruanhaishen
hiredis
Commits
c18b5889
Commit
c18b5889
authored
Sep 19, 2010
by
Pieter Noordhuis
Browse files
Use auxiliary variable to store reply before free'ing the list
parent
62c8054d
Changes
1
Hide whitespace changes
Inline
Side-by-side
hiredis.c
View file @
c18b5889
...
@@ -274,6 +274,7 @@ static int processItem(redisReader *r) {
...
@@ -274,6 +274,7 @@ static int processItem(redisReader *r) {
#define READ_BUFFER_SIZE 2048
#define READ_BUFFER_SIZE 2048
static
redisReply
*
redisReadReply
(
int
fd
)
{
static
redisReply
*
redisReadReply
(
int
fd
)
{
redisReply
*
reply
;
redisReader
r
;
redisReader
r
;
int
bytes
;
int
bytes
;
...
@@ -319,9 +320,10 @@ static redisReply *redisReadReply(int fd) {
...
@@ -319,9 +320,10 @@ static redisReply *redisReadReply(int fd) {
if
(
processItem
(
&
r
)
<
0
)
if
(
processItem
(
&
r
)
<
0
)
break
;
break
;
}
}
reply
=
r
.
rlist
[
0
];
free
(
r
.
buf
);
free
(
r
.
buf
);
free
(
r
.
rlist
);
free
(
r
.
rlist
);
return
r
.
rlist
[
0
]
;
return
r
eply
;
}
}
/* Helper function for redisCommand(). It's used to append the next argument
/* Helper function for redisCommand(). It's used to append the next argument
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment