]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
If we pass a NULL next to frame_set_next, just return calculate result, and NULLify...
authorArran Cudbard-Bell <a.cudbardb@freeradius.org>
Wed, 30 Apr 2025 18:12:11 +0000 (14:12 -0400)
committerArran Cudbard-Bell <a.cudbardb@freeradius.org>
Wed, 30 Apr 2025 20:22:50 +0000 (16:22 -0400)
src/lib/unlang/unlang_priv.h

index d02ac1a30e88bb8190c232c84db6b38721faf265..9713525380914f26e0b6062d80316f5c7cd14b17 100644 (file)
@@ -629,6 +629,19 @@ static inline void frame_repeat(unlang_stack_frame_t *frame, unlang_process_t pr
 
 static inline unlang_action_t frame_set_next(unlang_stack_frame_t *frame, unlang_t *unlang)
 {
+       /*
+        *      We're skipping the remaining siblings, stop the
+        *      interpreter from continuing and have it pop
+        *      this frame, running cleanups normally.
+        *
+        *      We don't explicitly cleanup here, otherwise we
+        *      end up doing it twice and bad things happen.
+        */
+       if (!unlang) {
+               frame->next = NULL;
+               return UNLANG_ACTION_CALCULATE_RESULT;
+       }
+
        /*
         *      Clean up this frame now, so that stats, etc. will be
         *      processed using the correct frame.