From a209d5d8e1bea2b37a7cddebe1f275da4ebde4e3 Mon Sep 17 00:00:00 2001 From: Ondrej Zajicek Date: Mon, 15 Aug 2011 02:06:56 +0200 Subject: A minor fix in BSD. --- sysdep/bsd/krt-sock.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'sysdep') diff --git a/sysdep/bsd/krt-sock.c b/sysdep/bsd/krt-sock.c index 9e3dcfe..f6bc4a2 100644 --- a/sysdep/bsd/krt-sock.c +++ b/sysdep/bsd/krt-sock.c @@ -697,8 +697,10 @@ krt_set_construct(struct krt_config *c UNUSED) void krt_set_shutdown(struct krt_proto *x UNUSED, int last UNUSED) { - if (krt_buffer) - mb_free(krt_buffer); + if (!krt_buffer) + return; + + mb_free(krt_buffer); krt_buffer = NULL; } @@ -720,6 +722,9 @@ krt_if_start(struct kif_proto *p UNUSED) void krt_if_shutdown(struct kif_proto *p UNUSED) { + if (!kif_buffer) + return; + mb_free(kif_buffer); kif_buffer = NULL; } -- cgit v1.2.3