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
f4f6b6d6
Commit
f4f6b6d6
authored
Dec 12, 2018
by
Mark Nunberg
Browse files
minor fixes: initialize options struct with 0 always
also, clean up redisContextInit -- we're just zeoring the struct
parent
7b705936
Changes
1
Hide whitespace changes
Inline
Side-by-side
hiredis.c
View file @
f4f6b6d6
...
...
@@ -591,21 +591,14 @@ static redisContext *redisContextInit(const redisOptions *options) {
if
(
c
==
NULL
)
return
NULL
;
c
->
err
=
0
;
c
->
errstr
[
0
]
=
'\0'
;
c
->
obuf
=
sdsempty
();
c
->
flags
=
0
;
c
->
tcp
.
host
=
NULL
;
c
->
tcp
.
source_addr
=
NULL
;
c
->
unix_sock
.
path
=
NULL
;
c
->
timeout
=
NULL
;
c
->
reader
=
redisReaderCreate
();
if
(
c
->
obuf
==
NULL
||
c
->
reader
==
NULL
)
{
redisFree
(
c
);
return
NULL
;
}
(
void
)
options
;
/* options are used in other functions */
return
c
;
}
...
...
@@ -753,7 +746,8 @@ redisContext *redisConnectUnixNonBlock(const char *path) {
}
redisContext
*
redisConnectFd
(
int
fd
)
{
redisOptions
options
=
{
REDIS_CONN_USERFD
};
redisOptions
options
=
{
0
};
options
.
type
=
REDIS_CONN_USERFD
;
options
.
endpoint
.
fd
=
fd
;
return
redisConnectWithOptions
(
&
options
);
}
...
...
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