Skip to content

Commit

Permalink
[#164] set message buffer payload to NULL before freeing
Browse files Browse the repository at this point in the history
  • Loading branch information
Jubilee101 authored and jesperpedersen committed Jan 7, 2024
1 parent e28eacb commit df71b18
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/libpgmoneta/wal.c
Original file line number Diff line number Diff line change
Expand Up @@ -392,6 +392,10 @@ pgmoneta_wal(int srv, char** argv)

pgmoneta_free_copy_message(identify_system_msg);
pgmoneta_free_copy_message(start_replication_msg);
if (msg != NULL)
{
msg->data = NULL;
}
pgmoneta_free_copy_message(msg);
pgmoneta_free_query_response(identify_system_response);
pgmoneta_memory_stream_buffer_free(buffer);
Expand All @@ -416,6 +420,10 @@ pgmoneta_wal(int srv, char** argv)
}
pgmoneta_free_copy_message(identify_system_msg);
pgmoneta_free_copy_message(start_replication_msg);
if (msg != NULL)
{
msg->data = NULL;
}
pgmoneta_free_copy_message(msg);
pgmoneta_free_query_response(identify_system_response);
pgmoneta_memory_stream_buffer_free(buffer);
Expand Down

0 comments on commit df71b18

Please sign in to comment.