GNUNET_free_non_null is gone, use GNUNET_free

This commit is contained in:
Christian Grothoff 2020-07-05 16:56:41 +02:00
parent 9c752b3d03
commit e428783e2e
No known key found for this signature in database
GPG Key ID: 939E6BE1E29FC3CC
30 changed files with 52 additions and 52 deletions

View File

@ -111,10 +111,10 @@ main (int argc,
GNUNET_log (GNUNET_ERROR_TYPE_ERROR, GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
"Malformed configuration file `%s', exit ...\n", "Malformed configuration file `%s', exit ...\n",
cfgfile); cfgfile);
GNUNET_free_non_null (cfgfile); GNUNET_free (cfgfile);
return 1; return 1;
} }
GNUNET_free_non_null (cfgfile); GNUNET_free (cfgfile);
if (! remove_flag) if (! remove_flag)
{ {

View File

@ -579,10 +579,10 @@ main (int argc,
GNUNET_log (GNUNET_ERROR_TYPE_ERROR, GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
"Malformed configuration file `%s', exiting ...\n", "Malformed configuration file `%s', exiting ...\n",
cfgfile); cfgfile);
GNUNET_free_non_null (cfgfile); GNUNET_free (cfgfile);
return 1; return 1;
} }
GNUNET_free_non_null (cfgfile); GNUNET_free (cfgfile);
if (GNUNET_OK != if (GNUNET_OK !=
auditor_serve_process_config ()) auditor_serve_process_config ())

View File

@ -213,10 +213,10 @@ main (int argc,
GNUNET_log (GNUNET_ERROR_TYPE_ERROR, GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
"Malformed configuration file `%s', exiting ...\n", "Malformed configuration file `%s', exiting ...\n",
cfgfile); cfgfile);
GNUNET_free_non_null (cfgfile); GNUNET_free (cfgfile);
return 1; return 1;
} }
GNUNET_free_non_null (cfgfile); GNUNET_free (cfgfile);
if ( (NULL == auditor_key_file) && if ( (NULL == auditor_key_file) &&
(GNUNET_OK != (GNUNET_OK !=
GNUNET_CONFIGURATION_get_value_filename (cfg, GNUNET_CONFIGURATION_get_value_filename (cfg,

View File

@ -1351,7 +1351,7 @@ refresh_session_cb (void *cls,
if (GNUNET_OK != reveal_ctx.err) if (GNUNET_OK != reveal_ctx.err)
{ {
GNUNET_free_non_null (reveal_ctx.new_issues); GNUNET_free (reveal_ctx.new_issues);
return (GNUNET_SYSERR == reveal_ctx.err) ? GNUNET_SYSERR : GNUNET_OK; return (GNUNET_SYSERR == reveal_ctx.err) ? GNUNET_SYSERR : GNUNET_OK;
} }
@ -1458,7 +1458,7 @@ refresh_session_cb (void *cls,
&value); &value);
} }
} }
GNUNET_free_non_null (reveal_ctx.new_issues); GNUNET_free (reveal_ctx.new_issues);
} }
/* update old coin's denomination balance */ /* update old coin's denomination balance */

View File

@ -1270,7 +1270,7 @@ verify_reserve_balance (void *cls,
GNUNET_CONTAINER_multihashmap_remove (rc->reserves, GNUNET_CONTAINER_multihashmap_remove (rc->reserves,
key, key,
rs)); rs));
GNUNET_free_non_null (rs->sender_account); GNUNET_free (rs->sender_account);
GNUNET_free (rs); GNUNET_free (rs);
return ret; return ret;
} }

View File

@ -1314,7 +1314,7 @@ handle_mhd_request (void *cls,
upload_data, upload_data,
upload_data_size, upload_data_size,
con_cls); con_cls);
GNUNET_free_non_null (account); GNUNET_free (account);
return ret; return ret;
} }

View File

@ -993,7 +993,7 @@ main (int argc,
argc, argc,
argv))) argv)))
{ {
GNUNET_free_non_null (cfg_filename); GNUNET_free (cfg_filename);
return BAD_CLI_ARG; return BAD_CLI_ARG;
} }
GNUNET_log_setup ("taler-exchange-benchmark", GNUNET_log_setup ("taler-exchange-benchmark",
@ -1010,7 +1010,7 @@ main (int argc,
else else
{ {
TALER_LOG_ERROR ("Unknown mode given: '%s'\n", mode_str); TALER_LOG_ERROR ("Unknown mode given: '%s'\n", mode_str);
GNUNET_free_non_null (cfg_filename); GNUNET_free (cfg_filename);
return BAD_CONFIG_FILE; return BAD_CONFIG_FILE;
} }
if (NULL == cfg_filename) if (NULL == cfg_filename)

View File

@ -111,6 +111,6 @@ TALER_curl_easy_post_finished (struct TALER_CURL_PostContext *ctx)
{ {
curl_slist_free_all (ctx->headers); curl_slist_free_all (ctx->headers);
ctx->headers = NULL; ctx->headers = NULL;
GNUNET_free_non_null (ctx->json_enc); GNUNET_free (ctx->json_enc);
ctx->json_enc = NULL; ctx->json_enc = NULL;
} }

View File

@ -1249,8 +1249,8 @@ main (int argc,
GNUNET_log_setup ("taler-exchange-httpd", GNUNET_log_setup ("taler-exchange-httpd",
(NULL == loglev) ? "INFO" : loglev, (NULL == loglev) ? "INFO" : loglev,
logfile)); logfile));
GNUNET_free_non_null (loglev); GNUNET_free (loglev);
GNUNET_free_non_null (logfile); GNUNET_free (logfile);
if (NULL == cfgfile) if (NULL == cfgfile)
cfgfile = GNUNET_strdup (GNUNET_OS_project_data_get ()->user_config_file); cfgfile = GNUNET_strdup (GNUNET_OS_project_data_get ()->user_config_file);
TEH_cfg = GNUNET_CONFIGURATION_create (); TEH_cfg = GNUNET_CONFIGURATION_create ();
@ -1261,10 +1261,10 @@ main (int argc,
GNUNET_log (GNUNET_ERROR_TYPE_ERROR, GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
"Malformed configuration file `%s', exit ...\n", "Malformed configuration file `%s', exit ...\n",
cfgfile); cfgfile);
GNUNET_free_non_null (cfgfile); GNUNET_free (cfgfile);
return 1; return 1;
} }
GNUNET_free_non_null (cfgfile); GNUNET_free (cfgfile);
if (GNUNET_OK != if (GNUNET_OK !=
exchange_serve_process_config ()) exchange_serve_process_config ())
return 1; return 1;

View File

@ -608,7 +608,7 @@ resolve_refreshes_reveal_denominations (struct TEH_KS_StateHandle *key_state,
if (GNUNET_OK != res) if (GNUNET_OK != res)
{ {
for (unsigned int j = 0; j<i; j++) for (unsigned int j = 0; j<i; j++)
GNUNET_free_non_null (rcds[j].coin_ev); GNUNET_free (rcds[j].coin_ev);
return (GNUNET_NO == res) ? MHD_YES : MHD_NO; return (GNUNET_NO == res) ? MHD_YES : MHD_NO;
} }
rcd->dk = &dkis[i]->denom_pub; rcd->dk = &dkis[i]->denom_pub;
@ -792,7 +792,7 @@ cleanup:
rctx->ev_sigs = NULL; /* just to be safe... */ rctx->ev_sigs = NULL; /* just to be safe... */
} }
for (unsigned int i = 0; i<num_fresh_coins; i++) for (unsigned int i = 0; i<num_fresh_coins; i++)
GNUNET_free_non_null (rcds[i].coin_ev); GNUNET_free (rcds[i].coin_ev);
return ret; return ret;
} }

View File

@ -395,7 +395,7 @@ free_ctx (struct WtidTransactionContext *ctx)
wdd); wdd);
GNUNET_free (wdd); GNUNET_free (wdd);
} }
GNUNET_free_non_null (ctx->wire_method); GNUNET_free (ctx->wire_method);
ctx->wire_method = NULL; ctx->wire_method = NULL;
} }

View File

@ -125,7 +125,7 @@ check_for_account (void *cls,
} }
GNUNET_free (payto_uri); GNUNET_free (payto_uri);
GNUNET_free (method); GNUNET_free (method);
GNUNET_free_non_null (wire_response_filename); GNUNET_free (wire_response_filename);
} }

View File

@ -40,8 +40,8 @@ common_free_reserve_history (void *cls,
struct TALER_EXCHANGEDB_BankTransfer *bt; struct TALER_EXCHANGEDB_BankTransfer *bt;
bt = rh->details.bank; bt = rh->details.bank;
GNUNET_free_non_null (bt->sender_account_details); GNUNET_free (bt->sender_account_details);
GNUNET_free_non_null (bt->wire_reference); GNUNET_free (bt->wire_reference);
GNUNET_free (bt); GNUNET_free (bt);
break; break;
} }
@ -68,7 +68,7 @@ common_free_reserve_history (void *cls,
struct TALER_EXCHANGEDB_ClosingTransfer *closing; struct TALER_EXCHANGEDB_ClosingTransfer *closing;
closing = rh->details.closing; closing = rh->details.closing;
GNUNET_free_non_null (closing->receiver_account_details); GNUNET_free (closing->receiver_account_details);
GNUNET_free (closing); GNUNET_free (closing);
break; break;
} }

View File

@ -3782,9 +3782,9 @@ cleanup:
GNUNET_CRYPTO_rsa_public_key_free (rrc->denom_pub.rsa_public_key); GNUNET_CRYPTO_rsa_public_key_free (rrc->denom_pub.rsa_public_key);
if (NULL != rrc->coin_sig.rsa_signature) if (NULL != rrc->coin_sig.rsa_signature)
GNUNET_CRYPTO_rsa_signature_free (rrc->coin_sig.rsa_signature); GNUNET_CRYPTO_rsa_signature_free (rrc->coin_sig.rsa_signature);
GNUNET_free_non_null (rrc->coin_ev); GNUNET_free (rrc->coin_ev);
} }
GNUNET_free_non_null (grctx.rrcs); GNUNET_free (grctx.rrcs);
return qs; return qs;
} }

View File

@ -706,12 +706,12 @@ drop:
destroy_denom_key_pair (dkp); destroy_denom_key_pair (dkp);
GNUNET_CRYPTO_rsa_signature_free ( GNUNET_CRYPTO_rsa_signature_free (
refresh_session.coin.denom_sig.rsa_signature); refresh_session.coin.denom_sig.rsa_signature);
GNUNET_free_non_null (new_denom_pubs); GNUNET_free (new_denom_pubs);
for (unsigned int cnt = 0; for (unsigned int cnt = 0;
(NULL != new_dkp) && (cnt < MELT_NEW_COINS) && (NULL != new_dkp[cnt]); (NULL != new_dkp) && (cnt < MELT_NEW_COINS) && (NULL != new_dkp[cnt]);
cnt++) cnt++)
destroy_denom_key_pair (new_dkp[cnt]); destroy_denom_key_pair (new_dkp[cnt]);
GNUNET_free_non_null (new_dkp); GNUNET_free (new_dkp);
return ret; return ret;
} }

View File

@ -164,6 +164,6 @@ EXITIF_exit:
} }
if (NULL != cfg) if (NULL != cfg)
GNUNET_CONFIGURATION_destroy (cfg); GNUNET_CONFIGURATION_destroy (cfg);
GNUNET_free_non_null (tmpfile); GNUNET_free (tmpfile);
return ret; return ret;
} }

View File

@ -194,14 +194,14 @@ main (int argc,
ret = 0; ret = 0;
EXITIF_exit: EXITIF_exit:
GNUNET_free_non_null (enc); GNUNET_free (enc);
GNUNET_free_non_null (tmpfile); GNUNET_free (tmpfile);
if (NULL != tmpdir) if (NULL != tmpdir)
{ {
(void) GNUNET_DISK_directory_remove (tmpdir); (void) GNUNET_DISK_directory_remove (tmpdir);
GNUNET_free (tmpdir); GNUNET_free (tmpdir);
} }
GNUNET_free_non_null (enc_read); GNUNET_free (enc_read);
if (NULL != dki.denom_priv.rsa_private_key) if (NULL != dki.denom_priv.rsa_private_key)
GNUNET_CRYPTO_rsa_private_key_free (dki.denom_priv.rsa_private_key); GNUNET_CRYPTO_rsa_private_key_free (dki.denom_priv.rsa_private_key);
if (NULL != dki.denom_pub.rsa_public_key) if (NULL != dki.denom_pub.rsa_public_key)

View File

@ -525,7 +525,7 @@ TALER_AUDITOR_disconnect (struct TALER_AUDITOR_Handle *auditor)
free_version_request (auditor->vr); free_version_request (auditor->vr);
auditor->vr = NULL; auditor->vr = NULL;
} }
GNUNET_free_non_null (auditor->version); GNUNET_free (auditor->version);
if (NULL != auditor->retry_task) if (NULL != auditor->retry_task)
{ {
GNUNET_SCHEDULER_cancel (auditor->retry_task); GNUNET_SCHEDULER_cancel (auditor->retry_task);

View File

@ -427,8 +427,8 @@ TALER_EXCHANGE_free_reserve_history (
switch (rhistory[i].type) switch (rhistory[i].type)
{ {
case TALER_EXCHANGE_RTT_CREDIT: case TALER_EXCHANGE_RTT_CREDIT:
GNUNET_free_non_null (rhistory[i].details.in_details.wire_reference); GNUNET_free (rhistory[i].details.in_details.wire_reference);
GNUNET_free_non_null (rhistory[i].details.in_details.sender_url); GNUNET_free (rhistory[i].details.in_details.sender_url);
break; break;
case TALER_EXCHANGE_RTT_WITHDRAWAL: case TALER_EXCHANGE_RTT_WITHDRAWAL:
break; break;

View File

@ -1135,7 +1135,7 @@ free_key_data (struct TALER_EXCHANGE_Keys *key_data)
GNUNET_array_grow (key_data->auditors, GNUNET_array_grow (key_data->auditors,
key_data->auditors_size, key_data->auditors_size,
0); 0);
GNUNET_free_non_null (key_data->version); GNUNET_free (key_data->version);
key_data->version = NULL; key_data->version = NULL;
} }

View File

@ -61,7 +61,7 @@ TALER_EXCHANGE_free_melt_data_ (struct MeltData *md)
} }
for (unsigned int i = 0; i<TALER_CNC_KAPPA; i++) for (unsigned int i = 0; i<TALER_CNC_KAPPA; i++)
GNUNET_free_non_null (md->fresh_coins[i]); GNUNET_free (md->fresh_coins[i]);
/* Finally, clean up a bit... */ /* Finally, clean up a bit... */
GNUNET_CRYPTO_zero_keys (md, GNUNET_CRYPTO_zero_keys (md,
sizeof (struct MeltData)); sizeof (struct MeltData));
@ -613,8 +613,8 @@ TALER_EXCHANGE_refresh_prepare (
for (unsigned int i = 0; i < TALER_CNC_KAPPA; i++) for (unsigned int i = 0; i < TALER_CNC_KAPPA; i++)
{ {
for (unsigned int j = 0; j < fresh_pks_len; j++) for (unsigned int j = 0; j < fresh_pks_len; j++)
GNUNET_free_non_null (rce[i].new_coins[j].coin_ev); GNUNET_free (rce[i].new_coins[j].coin_ev);
GNUNET_free_non_null (rce[i].new_coins); GNUNET_free (rce[i].new_coins);
} }
TALER_EXCHANGE_free_melt_data_ (&md); TALER_EXCHANGE_free_melt_data_ (&md);
return buf; return buf;

View File

@ -549,7 +549,7 @@ history_cleanup (void *cls,
GNUNET_free (hs->account_url); GNUNET_free (hs->account_url);
for (unsigned int off = 0; off<hs->total; off++) for (unsigned int off = 0; off<hs->total; off++)
GNUNET_free (hs->h[off].url); GNUNET_free (hs->h[off].url);
GNUNET_free_non_null (hs->h); GNUNET_free (hs->h);
GNUNET_free (hs); GNUNET_free (hs);
} }

View File

@ -552,7 +552,7 @@ history_cleanup (void *cls,
GNUNET_free (hs->h[off].c_url); GNUNET_free (hs->h[off].c_url);
GNUNET_free (hs->h[off].d_url); GNUNET_free (hs->h[off].d_url);
} }
GNUNET_free_non_null (hs->h); GNUNET_free (hs->h);
GNUNET_free (hs); GNUNET_free (hs);
} }

View File

@ -99,7 +99,7 @@ batch_cleanup (void *cls,
i++) i++)
bs->batch[i].cleanup (bs->batch[i].cls, bs->batch[i].cleanup (bs->batch[i].cls,
&bs->batch[i]); &bs->batch[i]);
GNUNET_free_non_null (bs->batch); GNUNET_free (bs->batch);
GNUNET_free (bs); GNUNET_free (bs);
} }

View File

@ -166,7 +166,7 @@ auditor_sign_cleanup (void *cls,
GNUNET_OS_process_destroy (ass->auditor_sign_proc); GNUNET_OS_process_destroy (ass->auditor_sign_proc);
ass->auditor_sign_proc = NULL; ass->auditor_sign_proc = NULL;
} }
GNUNET_free_non_null (ass->signed_keys_out); GNUNET_free (ass->signed_keys_out);
GNUNET_free (ass); GNUNET_free (ass);
} }

View File

@ -514,7 +514,7 @@ refresh_reveal_cleanup (void *cls,
for (unsigned int j = 0; j < rrs->num_fresh_coins; j++) for (unsigned int j = 0; j < rrs->num_fresh_coins; j++)
GNUNET_CRYPTO_rsa_signature_free (rrs->fresh_coins[j].sig.rsa_signature); GNUNET_CRYPTO_rsa_signature_free (rrs->fresh_coins[j].sig.rsa_signature);
GNUNET_free_non_null (rrs->fresh_coins); GNUNET_free (rrs->fresh_coins);
rrs->fresh_coins = NULL; rrs->fresh_coins = NULL;
rrs->num_fresh_coins = 0; rrs->num_fresh_coins = 0;
GNUNET_free (rrs); GNUNET_free (rrs);
@ -1128,12 +1128,12 @@ melt_cleanup (void *cls,
for (unsigned int i = 0; i < rms->num_fresh_coins; i++) for (unsigned int i = 0; i < rms->num_fresh_coins; i++)
GNUNET_CRYPTO_rsa_public_key_free (rms->fresh_pks[i].key.rsa_public_key); GNUNET_CRYPTO_rsa_public_key_free (rms->fresh_pks[i].key.rsa_public_key);
} }
GNUNET_free_non_null (rms->fresh_pks); GNUNET_free (rms->fresh_pks);
rms->fresh_pks = NULL; rms->fresh_pks = NULL;
GNUNET_free_non_null (rms->refresh_data); GNUNET_free (rms->refresh_data);
rms->refresh_data = NULL; rms->refresh_data = NULL;
rms->refresh_data_length = 0; rms->refresh_data_length = 0;
GNUNET_free_non_null (rms->melt_fresh_amounts); GNUNET_free (rms->melt_fresh_amounts);
GNUNET_free (rms); GNUNET_free (rms);
} }

View File

@ -85,7 +85,7 @@ revoke_cleanup (void *cls,
GNUNET_OS_process_destroy (rs->revoke_proc); GNUNET_OS_process_destroy (rs->revoke_proc);
rs->revoke_proc = NULL; rs->revoke_proc = NULL;
} }
GNUNET_free_non_null (rs->dhks); GNUNET_free (rs->dhks);
GNUNET_free (rs); GNUNET_free (rs);
} }

View File

@ -117,7 +117,7 @@ serialize_keys_cleanup (void *cls,
{ {
json_decref (sks->keys); json_decref (sks->keys);
} }
GNUNET_free_non_null (sks->exchange_url); GNUNET_free (sks->exchange_url);
GNUNET_free (sks); GNUNET_free (sks);
} }

View File

@ -387,7 +387,7 @@ withdraw_cleanup (void *cls,
TALER_EXCHANGE_destroy_denomination_key (ws->pk); TALER_EXCHANGE_destroy_denomination_key (ws->pk);
ws->pk = NULL; ws->pk = NULL;
} }
GNUNET_free_non_null (ws->exchange_url); GNUNET_free (ws->exchange_url);
GNUNET_free (ws); GNUNET_free (ws);
} }

View File

@ -354,7 +354,7 @@ do_shutdown (void *cls)
TALER_FAKEBANK_stop (is->fakebank); TALER_FAKEBANK_stop (is->fakebank);
is->fakebank = NULL; is->fakebank = NULL;
} }
GNUNET_free_non_null (is->commands); GNUNET_free (is->commands);
} }
@ -812,7 +812,7 @@ TALER_TESTING_setup (TALER_TESTING_Main main_cb,
&main_ctx); &main_ctx);
if (NULL != is.final_cleanup_cb) if (NULL != is.final_cleanup_cb)
is.final_cleanup_cb (is.final_cleanup_cb_cls); is.final_cleanup_cb (is.final_cleanup_cb_cls);
GNUNET_free_non_null (main_ctx.exchange_url); GNUNET_free (main_ctx.exchange_url);
GNUNET_SIGNAL_handler_uninstall (shc_chld); GNUNET_SIGNAL_handler_uninstall (shc_chld);
GNUNET_DISK_pipe_close (sigpipe); GNUNET_DISK_pipe_close (sigpipe);
sigpipe = NULL; sigpipe = NULL;