Browse Source

Fix use before null check

pull/992/head
Hamish Coleman 3 years ago
parent
commit
47768758d6
  1. 6
      src/sn_utils.c
  2. 5
      src/transform_aes.c
  3. 5
      src/transform_cc20.c
  4. 5
      src/transform_speck.c
  5. 5
      src/transform_tf.c

6
src/sn_utils.c

@ -1348,8 +1348,10 @@ static int re_register_and_purge_supernodes (n2n_sn_t *sss, struct sn_community
} }
// purge long-time-not-seen supernodes // purge long-time-not-seen supernodes
purge_expired_nodes(&(comm->edges), sss->sock, &sss->tcp_connections, p_last_re_reg_and_purge, if (comm) {
RE_REG_AND_PURGE_FREQUENCY, LAST_SEEN_SN_INACTIVE); purge_expired_nodes(&(comm->edges), sss->sock, &sss->tcp_connections, p_last_re_reg_and_purge,
RE_REG_AND_PURGE_FREQUENCY, LAST_SEEN_SN_INACTIVE);
}
} }
if(comm != NULL) { if(comm != NULL) {

5
src/transform_aes.c

@ -41,10 +41,9 @@ static int transop_deinit_aes (n2n_trans_op_t *arg) {
transop_aes_t *priv = (transop_aes_t *)arg->priv; transop_aes_t *priv = (transop_aes_t *)arg->priv;
if(priv->ctx)
aes_deinit(priv->ctx);
if(priv) if(priv)
if(priv->ctx)
aes_deinit(priv->ctx);
free(priv); free(priv);
return 0; return 0;

5
src/transform_cc20.c

@ -33,10 +33,9 @@ static int transop_deinit_cc20 (n2n_trans_op_t *arg) {
transop_cc20_t *priv = (transop_cc20_t *)arg->priv; transop_cc20_t *priv = (transop_cc20_t *)arg->priv;
if(priv->ctx)
cc20_deinit(priv->ctx);
if(priv) if(priv)
if(priv->ctx)
cc20_deinit(priv->ctx);
free(priv); free(priv);
return 0; return 0;

5
src/transform_speck.c

@ -33,10 +33,9 @@ static int transop_deinit_speck (n2n_trans_op_t *arg) {
transop_speck_t *priv = (transop_speck_t *)arg->priv; transop_speck_t *priv = (transop_speck_t *)arg->priv;
if(priv->ctx)
speck_deinit(priv->ctx);
if(priv) if(priv)
if(priv->ctx)
speck_deinit(priv->ctx);
free(priv); free(priv);
return 0; return 0;

5
src/transform_tf.c

@ -41,10 +41,9 @@ static int transop_deinit_tf (n2n_trans_op_t *arg) {
transop_tf_t *priv = (transop_tf_t *)arg->priv; transop_tf_t *priv = (transop_tf_t *)arg->priv;
if(priv->ctx)
tf_deinit(priv->ctx);
if(priv) if(priv)
if(priv->ctx)
tf_deinit(priv->ctx);
free(priv); free(priv);
return 0; return 0;

Loading…
Cancel
Save