]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
cb goes out of scope...
authorArran Cudbard-Bell <a.cudbardb@freeradius.org>
Thu, 29 Aug 2024 11:30:41 +0000 (06:30 -0500)
committerArran Cudbard-Bell <a.cudbardb@freeradius.org>
Thu, 29 Aug 2024 11:30:41 +0000 (06:30 -0500)
src/lib/bio/base.c

index 7f95173526644bd7fc8b7808e54dc6e7ce613806..ecabbdde0fe8d4642bd0a1e038bbf39b84f2fe5b 100644 (file)
@@ -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.