summaryrefslogtreecommitdiffstats
path: root/pb_decode.c
diff options
context:
space:
mode:
authorPetteri Aimonen <jpa@git.mail.kapsi.fi>2015-10-25 18:07:23 +0200
committerPetteri Aimonen <jpa@git.mail.kapsi.fi>2015-10-25 18:07:23 +0200
commit6c136580a091a30e94aaebd66dd978117d999ad0 (patch)
tree670427755d8bc2912c83001ca51fadd277f88347 /pb_decode.c
parentd9107adbc0c9c2ee9e899a78877a95d350a5a9aa (diff)
Ignore null pointers in pb_release() (issue #183).
Diffstat (limited to 'pb_decode.c')
-rw-r--r--pb_decode.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/pb_decode.c b/pb_decode.c
index 5cdcbcfb..50ada86a 100644
--- a/pb_decode.c
+++ b/pb_decode.c
@@ -1067,6 +1067,9 @@ void pb_release(const pb_field_t fields[], void *dest_struct)
{
pb_field_iter_t iter;
+ if (!dest_struct)
+ return; /* Ignore NULL pointers, similar to free() */
+
if (!pb_field_iter_begin(&iter, fields, dest_struct))
return; /* Empty message type */