summaryrefslogtreecommitdiff
path: root/src/bank-lib/test_bank_api.c
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2019-09-15 10:27:39 +0200
committerChristian Grothoff <christian@grothoff.org>2019-09-15 10:27:39 +0200
commitfc19601efc46cf31bf81c0d5980d6802148f5964 (patch)
tree5f61135b55d83480db7e0d070361c6a913495c5e /src/bank-lib/test_bank_api.c
parent4cc86b52d215b1d56368403ab0faccd92f701336 (diff)
downloadexchange-fc19601efc46cf31bf81c0d5980d6802148f5964.tar.gz
exchange-fc19601efc46cf31bf81c0d5980d6802148f5964.tar.bz2
exchange-fc19601efc46cf31bf81c0d5980d6802148f5964.zip
fix memory leaks in test case
Diffstat (limited to 'src/bank-lib/test_bank_api.c')
-rw-r--r--src/bank-lib/test_bank_api.c57
1 files changed, 31 insertions, 26 deletions
diff --git a/src/bank-lib/test_bank_api.c b/src/bank-lib/test_bank_api.c
index 043234560..6ad47c825 100644
--- a/src/bank-lib/test_bank_api.c
+++ b/src/bank-lib/test_bank_api.c
@@ -1,21 +1,21 @@
/*
- This file is part of TALER
- Copyright (C) 2016, 2017 GNUnet e.V.
-
- TALER is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as
- published by the Free Software Foundation; either version 3,
- or (at your option) any later version.
-
- TALER is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty
- of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See
- the GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public
- License along with TALER; see the file COPYING. If not, see
- <http://www.gnu.org/licenses/>
-*/
+ This file is part of TALER
+ Copyright (C) 2016, 2017, 2019 GNUnet e.V.
+
+ TALER is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as
+ published by the Free Software Foundation; either version 3,
+ or (at your option) any later version.
+
+ TALER is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty
+ of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See
+ the GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public
+ License along with TALER; see the file COPYING. If not, see
+ <http://www.gnu.org/licenses/>
+ */
/**
* @file bank/test_bank_api.c
* @brief testcase to test bank's HTTP API interface
@@ -156,15 +156,20 @@ main (int argc,
if (NULL == (dbconn = getenv ("TALER_EXCHANGEDB_POSTGRES_CONFIG")))
dbconn = defaultdb;
- char *purgedb_cmd;
- GNUNET_asprintf (&purgedb_cmd,
- "taler-bank-manage -c bank.conf --with-db=%s django flush --no-input",
- dbconn);
- if (0 != system (purgedb_cmd))
{
- fprintf (stderr,
- "Could not purge database\n");
- return 77;
+ char *purgedb_cmd;
+
+ GNUNET_asprintf (&purgedb_cmd,
+ "taler-bank-manage -c bank.conf --with-db=%s django flush --no-input",
+ dbconn);
+ if (0 != system (purgedb_cmd))
+ {
+ fprintf (stderr,
+ "Could not purge database\n");
+ GNUNET_free (purgedb_cmd);
+ return 77;
+ }
+ GNUNET_free (purgedb_cmd);
}
bankd = GNUNET_OS_start_process (GNUNET_NO,
@@ -182,7 +187,7 @@ main (int argc,
{
fprintf (stderr,
"Failed to launch taler-bank-manage, skipping test\n");
- return 77; /* report 'skip' */
+ return 77; /* report 'skip' */
}
/* give child time to start and bind against the socket */
fprintf (stderr,