summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorNikolai Kondrashov <Nikolai.Kondrashov@redhat.com>2014-09-05 14:09:26 +0300
committerJakub Hrozek <jhrozek@redhat.com>2014-09-16 14:26:03 +0200
commitef105b3848894920eda52f4c5e38e9fb7b5ac616 (patch)
tree99d3f15dfa12343ccf7995ce9822ef0882663fc7 /src
parent78b36a46eab73605439b88307e7d4848787da236 (diff)
downloadsssd-ef105b3848894920eda52f4c5e38e9fb7b5ac616.tar.gz
sssd-ef105b3848894920eda52f4c5e38e9fb7b5ac616.tar.xz
sssd-ef105b3848894920eda52f4c5e38e9fb7b5ac616.zip
TESTS: Free retrieved sid in test_getsidbyname
Free sid retrieved with sss_nss_getsidbyname in test_getsidbyname. Reviewed-by: Jakub Hrozek <jhrozek@redhat.com>
Diffstat (limited to 'src')
-rw-r--r--src/tests/cmocka/sss_nss_idmap-tests.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/tests/cmocka/sss_nss_idmap-tests.c b/src/tests/cmocka/sss_nss_idmap-tests.c
index e4831a33f..034f3a1ec 100644
--- a/src/tests/cmocka/sss_nss_idmap-tests.c
+++ b/src/tests/cmocka/sss_nss_idmap-tests.c
@@ -70,7 +70,7 @@ enum nss_status sss_nss_make_request(enum sss_cli_command cmd,
void test_getsidbyname(void **state) {
int ret;
- char *sid;
+ char *sid = NULL;
size_t c;
enum sss_id_type type;
@@ -94,6 +94,8 @@ void test_getsidbyname(void **state) {
ret = sss_nss_getsidbyname("", &sid, NULL);
assert_int_equal(ret, EINVAL);
+ free(sid);
+ sid = NULL;
for (c = 0; d[c].d.repbuf != NULL; c++) {
will_return(sss_nss_make_request, &d[0].d);
@@ -104,6 +106,8 @@ void test_getsidbyname(void **state) {
assert_string_equal(sid, d[0].str);
assert_int_equal(type, 0);
}
+ free(sid);
+ sid = NULL;
}
}