summaryrefslogtreecommitdiff
path: root/test.c
diff options
context:
space:
mode:
Diffstat (limited to 'test.c')
-rw-r--r--test.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/test.c b/test.c
index 43c034c..f0348ee 100644
--- a/test.c
+++ b/test.c
@@ -29,7 +29,10 @@ int main(void)
free(pass);
struct rt_user *user = NULL;
- if (rtclient_userget(&user, name))
+ rtclient_userget(&user, name);
+ free(name);
+
+ if (user) {
printf("id: %s\npassword: %s\nname: %s\nemailaddress: %s\nrealname: %s\nnickname: %s\ngecos: %s\norganization: %s\naddress1: %s\naddress2: %s\ncity: %s\nstate: %s\nzip: %s\ncountry: %s\nhomephone: %s\nworkphone: %s\nmobilephone: %s\npagerphone: %s\ncontactinfo: %s\ncomments: %s\nsignature: %s\nlang: %s\nprivileged: %d\ndisabled: %d\n"
, user->id, user->password, user->name, user->emailaddress
, user->realname, user->nickname, user->gecos
@@ -39,9 +42,8 @@ int main(void)
, user->pagerphone, user->contactinfo, user->comments
, user->signature, user->lang, user->privileged
, user->disabled);
- free(name);
- if (user)
rtclient_userfree(user);
+ }
rtclient_cleanup();