When traversing a list of osrfMessages: don't free the messages.
authorscottmk <scottmk@9efc2488-bf62-4759-914b-345cdb29e865>
Mon, 14 Jun 2010 18:31:32 +0000 (18:31 +0000)
committerscottmk <scottmk@9efc2488-bf62-4759-914b-345cdb29e865>
Mon, 14 Jun 2010 18:31:32 +0000 (18:31 +0000)
The list owns them.  Instead, get the list to free them when
you're done, by calling osrfListClear().

M    src/router/osrf_router.c

git-svn-id: svn://svn.open-ils.org/OpenSRF/trunk@1957 9efc2488-bf62-4759-914b-345cdb29e865

src/router/osrf_router.c

index dcfb823..c1f4134 100644 (file)
@@ -794,7 +794,7 @@ static void osrfRouterHandleAppRequest( osrfRouter* router, const transport_mess
 
        // Translate the JSON into a list of osrfMessages
        router->message_list = osrfMessageDeserialize( msg->body, router->message_list );
-       osrfMessage* omsg = NULL;
+       const osrfMessage* omsg = NULL;
 
        // Process each osrfMessage
        int i;
@@ -816,10 +816,9 @@ static void osrfRouterHandleAppRequest( osrfRouter* router, const transport_mess
                                default:
                                        break;
                        }
-
-                       osrfMessageFree( omsg );
                }
        }
+       osrfListClear( router->message_list );
 
        return;
 }