Sfoglia il codice sorgente

qnetd: Assert dpd timer entry exists

Signed-off-by: Jan Friesse <jfriesse@redhat.com>
Jan Friesse 7 mesi fa
parent
commit
983374d1c7
1 ha cambiato i file con 4 aggiunte e 0 eliminazioni
  1. 4 0
      qdevices/qnetd-client-dpd-timer.c

+ 4 - 0
qdevices/qnetd-client-dpd-timer.c

@@ -32,6 +32,8 @@
  * THE POSSIBILITY OF SUCH DAMAGE.
  * THE POSSIBILITY OF SUCH DAMAGE.
  */
  */
 
 
+#include <assert.h>
+
 #include "log.h"
 #include "log.h"
 #include "qnetd-client-dpd-timer.h"
 #include "qnetd-client-dpd-timer.h"
 
 
@@ -42,6 +44,8 @@ qnetd_dpd_timer_cb(void *data1, void *data2)
 
 
 	client = (struct qnetd_client *)data1;
 	client = (struct qnetd_client *)data1;
 
 
+	assert(client->dpd_timer != NULL);
+
 	log(LOG_WARNING, "Client %s doesn't sent any message during "
 	log(LOG_WARNING, "Client %s doesn't sent any message during "
 	    "%" PRIu32 "ms. Disconnecting",
 	    "%" PRIu32 "ms. Disconnecting",
 	    client->addr_str,
 	    client->addr_str,