diff options
author | TheJackiMonster <thejackimonster@gmail.com> | 2021-10-31 18:20:05 +0100 |
---|---|---|
committer | TheJackiMonster <thejackimonster@gmail.com> | 2021-10-31 18:20:05 +0100 |
commit | 5a08e8a921163dc0dcd57d73e6ce76b98e5cc29e (patch) | |
tree | ce4d162423553bc5bdc1a085b7fca9a9ad811e27 /src/gnunet_chat_message.c | |
parent | aa9014fd46c64142fb087d7a7288f5347532e2fe (diff) | |
download | libgnunetchat-5a08e8a921163dc0dcd57d73e6ce76b98e5cc29e.tar.gz libgnunetchat-5a08e8a921163dc0dcd57d73e6ce76b98e5cc29e.zip |
Added assertions to ensure code safety
Signed-off-by: TheJackiMonster <thejackimonster@gmail.com>
Diffstat (limited to 'src/gnunet_chat_message.c')
-rw-r--r-- | src/gnunet_chat_message.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/gnunet_chat_message.c b/src/gnunet_chat_message.c index a396cf8..e044415 100644 --- a/src/gnunet_chat_message.c +++ b/src/gnunet_chat_message.c | |||
@@ -30,6 +30,10 @@ message_create_from_msg (struct GNUNET_CHAT_Context *context, | |||
30 | enum GNUNET_MESSENGER_MessageFlags flags, | 30 | enum GNUNET_MESSENGER_MessageFlags flags, |
31 | const struct GNUNET_MESSENGER_Message *msg) | 31 | const struct GNUNET_MESSENGER_Message *msg) |
32 | { | 32 | { |
33 | GNUNET_assert((context) && | ||
34 | (hash) && | ||
35 | (msg)); | ||
36 | |||
33 | struct GNUNET_CHAT_Message *message = GNUNET_new(struct GNUNET_CHAT_Message); | 37 | struct GNUNET_CHAT_Message *message = GNUNET_new(struct GNUNET_CHAT_Message); |
34 | 38 | ||
35 | message->context = context; | 39 | message->context = context; |
@@ -64,5 +68,7 @@ message_create_internally (struct GNUNET_CHAT_Context *context, | |||
64 | void | 68 | void |
65 | message_destroy (struct GNUNET_CHAT_Message* message) | 69 | message_destroy (struct GNUNET_CHAT_Message* message) |
66 | { | 70 | { |
71 | GNUNET_assert(message); | ||
72 | |||
67 | GNUNET_free(message); | 73 | GNUNET_free(message); |
68 | } | 74 | } |