Include commented-out code which can be used to debug memory usage
authoraland <aland>
Fri, 27 Aug 2004 18:56:55 +0000 (18:56 +0000)
committeraland <aland>
Fri, 27 Aug 2004 18:56:55 +0000 (18:56 +0000)
and allocation

src/main/radiusd.c

index 0b8a55e..359dd9f 100644 (file)
@@ -1167,6 +1167,22 @@ int main(int argc, char *argv[])
                         *      catches that, and exits.
                         */
                        if (errno == EINTR) {
+#ifdef MEMORY_USE_DEBUGGING
+                               /*
+                                *      Run the server in debugging mode,
+                                *      without threads, and give it a
+                                *      SIGHUP.  It will clean up after
+                                *      itself, and any memory left over
+                                *      should be allocated by C libraries,
+                                *      and the like.
+                                */
+                               detach_modules();
+                               rl_deinit();
+                               free_mainconfig();
+                               xlat_free();
+                               dict_free();
+                               exit(1);
+#endif
                                tv = rl_clean_list(time(NULL));
                                continue;
                        }