Previous patches introduced various issues:
- Removal of stream_free() to fix double free caused memleak
- Patch for memleak was incomplete
This should fix it hopefully.
Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
}
stream_free(msgc);
+ stream_free(msg);
}
static void zebra_ptm_send_clients(struct stream *msg)
}
stream_free(msgc);
+ stream_free(msg);
}
static int _zebra_ptm_bfd_client_deregister(struct zserv *zs)
zebra_ptm_send_bfdd(msg);
- stream_free(msg);
-
pp_free(pp);
return 0;
stream_putw_at(msgc, 0, STREAM_READABLE(msgc));
zebra_ptm_send_bfdd(msgc);
+ msgc = NULL;
/* Registrate process PID for shutdown hook. */
STREAM_GETL(msg, ppid);
return;
stream_failure:
- stream_free(msgc);
+ if (msgc)
+ stream_free(msgc);
zlog_err("%s:%d failed to registrate client pid", __FILE__, __LINE__);
}