From: Arran Cudbard-Bell Date: Thu, 29 Aug 2024 11:30:41 +0000 (-0500) Subject: cb goes out of scope... X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b90389801792e31c2c33eb343233f6d8937fd922;p=thirdparty%2Ffreeradius-server.git cb goes out of scope... --- diff --git a/src/lib/bio/base.c b/src/lib/bio/base.c index 7f951735266..ecabbdde0fe 100644 --- a/src/lib/bio/base.c +++ b/src/lib/bio/base.c @@ -222,9 +222,11 @@ void fr_bio_cb_set(fr_bio_t *bio, fr_bio_cb_funcs_t const *cb) { fr_bio_common_t *my = (fr_bio_common_t *) bio; - if (!cb) cb = &(fr_bio_cb_funcs_t) { }; - - my->cb = *cb; + if (!cb) { + memset(&my->cb, 0, sizeof(my->cb)); + } else { + my->cb = *cb; + } } /** Internal BIO function to run EOF callbacks.