avoid use after free
authorjsg <jsg@openbsd.org>
Fri, 22 Jul 2022 05:55:05 +0000 (05:55 +0000)
committerjsg <jsg@openbsd.org>
Fri, 22 Jul 2022 05:55:05 +0000 (05:55 +0000)
ok deraadt@

lib/libc/yp/yp_bind.c

index 7889e84..15db9ea 100644 (file)
@@ -1,4 +1,4 @@
-/*     $OpenBSD: yp_bind.c,v 1.30 2022/07/18 02:32:11 deraadt Exp $ */
+/*     $OpenBSD: yp_bind.c,v 1.31 2022/07/22 05:55:05 jsg Exp $ */
 /*
  * Copyright (c) 1992, 1993, 1996 Theo de Raadt <deraadt@theos.com>
  * All rights reserved.
@@ -81,6 +81,7 @@ again:
        if (ypbinding->dom_client == NULL) {
                close(ypbinding->dom_socket);
                free(ypbinding);
+               ypbinding = NULL;
                clnt_pcreateerror("clntudp_create");
                goto again;
        }