]> git.ipfire.org Git - thirdparty/shairport-sync.git/commitdiff
Fix a potential bug by checking that a buffer is not zero before attempting to deallo...
authorMike Brady <4265913+mikebrady@users.noreply.github.com>
Wed, 4 Dec 2024 16:06:22 +0000 (16:06 +0000)
committerMike Brady <4265913+mikebrady@users.noreply.github.com>
Wed, 4 Dec 2024 16:06:22 +0000 (16:06 +0000)
rtsp.c

diff --git a/rtsp.c b/rtsp.c
index 3c2e0b0e1e26bbd8834535930e4fe6c4b7fd5a1c..d83c7c1bfd8a2eb4ed9f5373c0f6b882deb67031 100644 (file)
--- a/rtsp.c
+++ b/rtsp.c
@@ -1439,7 +1439,10 @@ enum rtsp_read_request_response rtsp_read_request(rtsp_conn_info *conn, rtsp_mes
   *the_packet = msg;
 shutdown:
   if (reply != rtsp_read_request_response_ok) {
-    msg_free(the_packet);
+    if (*the_packet != NULL) {
+      debug(3, "Freeing the_packet");
+      msg_free(the_packet);
+    }
     release_buffer = 1; // allow the buffer to be released
   }
   pthread_cleanup_pop(release_buffer);