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
18eeeed0
Unverified
Commit
18eeeed0
authored
Oct 08, 2019
by
Michael Grunder
Committed by
GitHub
Oct 08, 2019
Browse files
Merge pull request #715 from redis/test-leaks
Fixes leaks in unit tests
parents
01535274
5aa7b105
Changes
1
Hide whitespace changes
Inline
Side-by-side
test.c
View file @
18eeeed0
...
...
@@ -269,14 +269,14 @@ static void test_format_commands(void) {
sds
sds_cmd
;
sds_cmd
=
sdsempty
()
;
sds_cmd
=
NULL
;
test
(
"Format command into sds by passing argc/argv without lengths: "
);
len
=
redisFormatSdsCommandArgv
(
&
sds_cmd
,
argc
,
argv
,
NULL
);
test_cond
(
strncmp
(
sds_cmd
,
"*3
\r\n
$3
\r\n
SET
\r\n
$3
\r\n
foo
\r\n
$3
\r\n
bar
\r\n
"
,
len
)
==
0
&&
len
==
4
+
4
+
(
3
+
2
)
+
4
+
(
3
+
2
)
+
4
+
(
3
+
2
));
sdsfree
(
sds_cmd
);
sds_cmd
=
sdsempty
()
;
sds_cmd
=
NULL
;
test
(
"Format command into sds by passing argc/argv with lengths: "
);
len
=
redisFormatSdsCommandArgv
(
&
sds_cmd
,
argc
,
argv
,
lens
);
test_cond
(
strncmp
(
sds_cmd
,
"*3
\r\n
$3
\r\n
SET
\r\n
$7
\r\n
foo
\0
xxx
\r\n
$3
\r\n
bar
\r\n
"
,
len
)
==
0
&&
...
...
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