Index: cc_cdg.c =================================================================== --- cc_cdg.c +++ cc_cdg.c @@ -337,6 +337,8 @@ struct qdiff_sample *qds, *qds_n; cdg_data = ccv->cc_data; + if (cdg_data == NULL) + return; qds = STAILQ_FIRST(&cdg_data->qdiffmin_q); while (qds != NULL) { @@ -353,6 +355,7 @@ } free(ccv->cc_data, M_CDG); + ccv->cc_data = NULL; } static int Index: cc_chd.c =================================================================== --- cc_chd.c +++ cc_chd.c @@ -307,8 +307,8 @@ chd_cb_destroy(struct cc_var *ccv) { - if (ccv->cc_data != NULL) - free(ccv->cc_data, M_CHD); + free(ccv->cc_data, M_CHD); + ccv->cc_data = NULL; } static int Index: cc_cubic.c =================================================================== --- cc_cubic.c +++ cc_cubic.c @@ -213,9 +213,8 @@ static void cubic_cb_destroy(struct cc_var *ccv) { - - if (ccv->cc_data != NULL) - free(ccv->cc_data, M_CUBIC); + free(ccv->cc_data, M_CUBIC); + ccv->cc_data = NULL; } static int Index: cc_dctcp.c =================================================================== --- cc_dctcp.c +++ cc_dctcp.c @@ -184,8 +184,8 @@ static void dctcp_cb_destroy(struct cc_var *ccv) { - if (ccv->cc_data != NULL) - free(ccv->cc_data, M_dctcp); + free(ccv->cc_data, M_dctcp); + ccv->cc_data = NULL; } static int Index: cc_htcp.c =================================================================== --- cc_htcp.c +++ cc_htcp.c @@ -238,9 +238,8 @@ static void htcp_cb_destroy(struct cc_var *ccv) { - - if (ccv->cc_data != NULL) - free(ccv->cc_data, M_HTCP); + free(ccv->cc_data, M_HTCP); + ccv->cc_data = NULL; } static int Index: cc_newreno.c =================================================================== --- cc_newreno.c +++ cc_newreno.c @@ -127,9 +127,8 @@ static void newreno_cb_destroy(struct cc_var *ccv) { - - if (ccv->cc_data != NULL) - free(ccv->cc_data, M_NEWRENO); + free(ccv->cc_data, M_NEWRENO); + ccv->cc_data = NULL; } static void Index: cc_vegas.c =================================================================== --- cc_vegas.c +++ cc_vegas.c @@ -170,9 +170,8 @@ static void vegas_cb_destroy(struct cc_var *ccv) { - - if (ccv->cc_data != NULL) - free(ccv->cc_data, M_VEGAS); + free(ccv->cc_data, M_VEGAS); + ccv->cc_data = NULL; } static int