Merge branch 'logging_changes' of https://github.com/adam-bishop/trust_router
[trust_router.git] / tr / tr_main.c
index e77d8aa..dc18ca0 100644 (file)
@@ -216,9 +216,11 @@ static int tr_tids_req_handler (TIDS_INSTANCE *tids,
   if (0 > (rc = tidc_fwd_request(tidc, fwd_req, &tr_tidc_resp_handler, (void *)&resp_cookie))) {
     tr_notice("Error from tidc_fwd_request, rc = %d.", rc);
     tids_send_err_response(tids, orig_req, "Can't forward request to next hop TIDS");
+    tid_req_free(orig_req);
     return -1;
   }
     
+  tid_req_free(orig_req);
   return 0;
 }
 
@@ -257,6 +259,9 @@ int main (int argc, const char *argv[])
 
   /* parse command-line arguments? -- TBD */
 
+  /* Use standalone logging */
+  tr_log_open();
+
   /* create a Trust Router instance */
   if (NULL == (tr = tr_create())) {
     tr_crit("Unable to create Trust Router instance, exiting.");