up and return failure, be sure the cleanup work does NOT free objects which
are still being referenced by other objects.
ok guenther@
-/* $OpenBSD: pcy_node.c,v 1.4 2014/06/12 15:49:31 deraadt Exp $ */
+/* $OpenBSD: pcy_node.c,v 1.5 2014/07/23 20:49:52 miod Exp $ */
/* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL
* project 2004.
*/
if (!tree->extra_data)
tree->extra_data = sk_X509_POLICY_DATA_new_null();
if (!tree->extra_data)
- goto node_error;
+ goto node_error_cond;
if (!sk_X509_POLICY_DATA_push(tree->extra_data, data))
- goto node_error;
+ goto node_error_cond;
}
if (parent)
return node;
+node_error_cond:
+ if (level)
+ node = NULL;
node_error:
policy_node_free(node);
- return 0;
+ return NULL;
}
void
-/* $OpenBSD: pcy_node.c,v 1.4 2014/06/12 15:49:31 deraadt Exp $ */
+/* $OpenBSD: pcy_node.c,v 1.5 2014/07/23 20:49:52 miod Exp $ */
/* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL
* project 2004.
*/
if (!tree->extra_data)
tree->extra_data = sk_X509_POLICY_DATA_new_null();
if (!tree->extra_data)
- goto node_error;
+ goto node_error_cond;
if (!sk_X509_POLICY_DATA_push(tree->extra_data, data))
- goto node_error;
+ goto node_error_cond;
}
if (parent)
return node;
+node_error_cond:
+ if (level)
+ node = NULL;
node_error:
policy_node_free(node);
- return 0;
+ return NULL;
}
void