mirror of
https://github.com/samba-team/samba.git
synced 2025-01-24 02:04:21 +03:00
lib:replace: Fix a memleak in test_strdup()
Found by covscan Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
This commit is contained in:
parent
2e973ea5f1
commit
dca03ffa8a
@ -164,11 +164,16 @@ static int test_memmove(void)
|
||||
static int test_strdup(void)
|
||||
{
|
||||
char *x;
|
||||
int cmp;
|
||||
|
||||
printf("test: strdup\n");
|
||||
x = strdup("bla");
|
||||
if (strcmp("bla", x) != 0) {
|
||||
|
||||
cmp = strcmp("bla", x);
|
||||
if (cmp != 0) {
|
||||
printf("failure: strdup [\nfailed: expected \"bla\", got \"%s\"\n]\n",
|
||||
x);
|
||||
free(x);
|
||||
return false;
|
||||
}
|
||||
free(x);
|
||||
|
Loading…
x
Reference in New Issue
Block a user