]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
Don't require test ctx functions
authorArran Cudbard-Bell <a.cudbardb@freeradius.org>
Sat, 2 Dec 2017 16:04:28 +0000 (16:04 +0000)
committerArran Cudbard-Bell <a.cudbardb@freeradius.org>
Sat, 2 Dec 2017 16:04:28 +0000 (16:04 +0000)
src/main/unit_test_attribute.c

index 3743449dd4ec7206b0489f83672249d0f4b3518d..91116cd62d26955aaee522cc5f7522a2ef69a645 100644 (file)
@@ -1154,7 +1154,7 @@ static void process_file(CONF_SECTION *features, fr_dict_t *dict, const char *ro
                        void                            *decoder_ctx;
 
                        p += load_test_point_by_command((void **)&tp, test_type, 11, "tp_decode") + 1;
-                       decoder_ctx = tp->test_ctx(tp_ctx);
+                       if (tp->test_ctx) decoder_ctx = tp->test_ctx(tp_ctx);
 
                        if (strcmp(p, "-") == 0) {
                                attr = data;
@@ -1222,7 +1222,7 @@ static void process_file(CONF_SECTION *features, fr_dict_t *dict, const char *ro
                        void                            *encoder_ctx;
 
                        p += load_test_point_by_command((void **)&tp, test_type, 11, "tp_encode") + 1;
-                       encoder_ctx = tp->test_ctx(tp_ctx);
+                       if (tp->test_ctx) encoder_ctx = tp->test_ctx(tp_ctx);
 
                        /*
                         *      Encode the previous output