=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/ldap/Attic/ber.c,v retrieving revision 1.19 retrieving revision 1.20 diff -u -r1.19 -r1.20 --- src/usr.bin/ldap/Attic/ber.c 2018/08/12 22:04:09 1.19 +++ src/usr.bin/ldap/Attic/ber.c 2018/11/20 07:20:21 1.20 @@ -1,4 +1,4 @@ -/* $OpenBSD: ber.c,v 1.19 2018/08/12 22:04:09 rob Exp $ */ +/* $OpenBSD: ber.c,v 1.20 2018/11/20 07:20:21 martijn Exp $ */ /* * Copyright (c) 2007, 2012 Reyk Floeter @@ -894,6 +894,8 @@ void ber_free_elements(struct ber_element *root) { + if (root == NULL) + return; if (root->be_sub && (root->be_encoding == BER_TYPE_SEQUENCE || root->be_encoding == BER_TYPE_SET)) ber_free_elements(root->be_sub);