patx/mrhttp-asgi

Free scd if no mrcache request

Commit 9c49c65 · MarkReedZ · 2024-03-06T19:13:38Z

Changeset
9c49c65ef44abfd2d4fdab42b2bae0a85119a181
Parents
05464e53d8b642c211e65e6bacfc667b18840549

View source at this commit

Comments

No comments yet.

Log in to comment

Diff

diff --git a/src/mrhttp/internals/protocol.c b/src/mrhttp/internals/protocol.c
index 335cc35..8daf2eb 100644
--- a/src/mrhttp/internals/protocol.c
+++ b/src/mrhttp/internals/protocol.c
@@ -503,6 +503,7 @@ Protocol* Protocol_on_body(Protocol* self, char* body, size_t body_len) {
 
       // If the get failed (no servers) then we're done
       if ( rc != 0 ) {
+        free(scd);
         Protocol_handle_request( self, self->request, r );
         return self;
       }
@@ -513,6 +514,7 @@ Protocol* Protocol_on_body(Protocol* self, char* body, size_t body_len) {
 
     // if mrq return now as the user is not logged in
     if ( r->mrq ) {
+      free(scd);
       return Protocol_handle_request( self, self->request, r );
     }