[jsonrpc-glib] input-stream: more cleanup and assertions



commit 26585afb6a562a9364ac0b389c587b491156b3da
Author: Christian Hergert <chergert redhat com>
Date:   Wed Dec 27 03:21:33 2017 -0800

    input-stream: more cleanup and assertions
    
    These should be freed later, but I want to see things cleaned up
    immediately after use.

 src/jsonrpc-input-stream.c | 2 ++
 1 file changed, 2 insertions(+)
---
diff --git a/src/jsonrpc-input-stream.c b/src/jsonrpc-input-stream.c
index a9069c8..5ce3d61 100644
--- a/src/jsonrpc-input-stream.c
+++ b/src/jsonrpc-input-stream.c
@@ -132,8 +132,10 @@ jsonrpc_input_stream_read_body_cb (GObject      *object,
   else
     {
       message = json_gvariant_deserialize_data (state->buffer, state->content_length, NULL, &error);
+      g_clear_pointer (&state->buffer, g_free);
     }
 
+  g_assert (state->buffer == NULL);
   g_assert (message != NULL || error != NULL);
 
   if (error != NULL)


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]