Added packet contet reference count debug loggin for memory leaks.
[silc.git] / lib / silccore / silcpacket.c
index 7054f600f6764145d6c3e6ab1ce2d2d4dcd19dfe..a6992105e1ab933489a01185edcc305faeb1b671 100644 (file)
@@ -746,6 +746,8 @@ SilcPacketContext *silc_packet_context_alloc()
 SilcPacketContext *silc_packet_context_dup(SilcPacketContext *ctx)
 {
   ctx->users++;
+  SILC_LOG_DEBUG(("Packet context %p rfcnt %d->%d", ctx, ctx->users - 1,
+                 ctx->users));
   return ctx;
 }
 
@@ -755,6 +757,8 @@ SilcPacketContext *silc_packet_context_dup(SilcPacketContext *ctx)
 void silc_packet_context_free(SilcPacketContext *ctx)
 {
   ctx->users--;
+  SILC_LOG_DEBUG(("Packet context %p rfcnt %d->%d", ctx, ctx->users + 1,
+                 ctx->users));
   if (ctx->users < 1)
     {
       if (ctx->buffer)