library/src/exploitation/Utilities/PHP/GadgetGenerators/BP-PHPGadgetGenerators.cc
// destroys a open PHP gadget library
destroys a open PHP gadget library
destroys a open PHP gadget library
BP_ERROR_T BP_PHPCloseDestroyGadgetLibrary(P_BP_PHP_GADGET_LIBRARY gadget_lib)
{
	if(!gadget_lib)
		return ERR_FAILURE;
	size_t n = 0;
	if(gadget_lib->gadget_n)
	{
		for(n=0; n< gadget_lib->gadget_n; n++)
		{
			if(gadget_lib->gadgets[n].runtime_tq)
			{
				BP_DestroyLinkL(gadget_lib->gadgets[n].runtime_tq, BP_TRUE);
			}
		}
	}
	BP_DestroyLinkL(gadget_lib->tq, BP_TRUE);
	bpfree(gadget_lib);
	return ERR_SUCCESS;
}
BP_ERROR_T BP_PHPCloseDestroyGadgetLibrary ( P_BP_PHP_GADGET_LIBRARY gadget_lib ) { if ( ! gadget_lib ) return ERR_FAILURE ; size_t n = 0 ; if ( gadget_lib -> gadget_n ) { for ( n = 0 ; n < gadget_lib -> gadget_n ; n ++ ) { if ( gadget_lib -> gadgets [ n ] . runtime_tq ) { BP_DestroyLinkL ( gadget_lib -> gadgets [ n ] . runtime_tq , BP_TRUE ) ; } } } BP_DestroyLinkL ( gadget_lib -> tq , BP_TRUE ) ; bpfree ( gadget_lib ) ; return ERR_SUCCESS ; }
destroys a open PHP gadget library
destroys a open PHP gadget library
// check to ensure we have a pointer // destroy gadget runtime tailqueue allocators // destroy all dangling chunks in the tail queue allocator // destroy structure itself // return indicating success