1130803Smarcel/*- 2130803Smarcel * Copyright (c) 2002-2003 Networks Associates Technology, Inc. 3130803Smarcel * Copyright (c) 2004-2011 Dag-Erling Sm��rgrav 4130803Smarcel * All rights reserved. 5130803Smarcel * 6130803Smarcel * This software was developed for the FreeBSD Project by ThinkSec AS and 7130803Smarcel * Network Associates Laboratories, the Security Research Division of 8130803Smarcel * Network Associates, Inc. under DARPA/SPAWAR contract N66001-01-C-8035 9130803Smarcel * ("CBOSS"), as part of the DARPA CHATS research program. 10130803Smarcel * 11130803Smarcel * Redistribution and use in source and binary forms, with or without 12130803Smarcel * modification, are permitted provided that the following conditions 13130803Smarcel * are met: 14130803Smarcel * 1. Redistributions of source code must retain the above copyright 15130803Smarcel * notice, this list of conditions and the following disclaimer. 16130803Smarcel * 2. Redistributions in binary form must reproduce the above copyright 17130803Smarcel * notice, this list of conditions and the following disclaimer in the 18130803Smarcel * documentation and/or other materials provided with the distribution. 19130803Smarcel * 3. The name of the author may not be used to endorse or promote 20130803Smarcel * products derived from this software without specific prior written 21130803Smarcel * permission. 22130803Smarcel * 23130803Smarcel * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND 24130803Smarcel * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 25130803Smarcel * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 26130803Smarcel * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE 27130803Smarcel * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 28130803Smarcel * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 29130803Smarcel * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 30130803Smarcel * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 31130803Smarcel * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 32130803Smarcel * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 33130803Smarcel * SUCH DAMAGE. 34130803Smarcel * 35130803Smarcel * $Id: openpam_free_data.c 648 2013-03-05 17:54:27Z des $ 36130803Smarcel */ 37130803Smarcel 38130803Smarcel#ifdef HAVE_CONFIG_H 39130803Smarcel# include "config.h" 40130803Smarcel#endif 41130803Smarcel 42130803Smarcel#include <stdlib.h> 43130803Smarcel#include <string.h> 44130803Smarcel 45130803Smarcel#include <security/pam_appl.h> 46130803Smarcel 47130803Smarcel#include "openpam_impl.h" 48130803Smarcel 49130803Smarcel/* 50130803Smarcel * OpenPAM extension 51130803Smarcel * 52130803Smarcel * Generic cleanup function 53130803Smarcel */ 54130803Smarcel 55130803Smarcelvoid 56130803Smarcelopenpam_free_data(pam_handle_t *pamh, 57130803Smarcel void *data, 58130803Smarcel int status) 59130803Smarcel{ 60130803Smarcel 61130803Smarcel ENTER(); 62130803Smarcel (void)pamh; 63130803Smarcel (void)status; 64130803Smarcel FREE(data); 65130803Smarcel RETURNV(); 66130803Smarcel} 67130803Smarcel 68130803Smarcel/* 69130803Smarcel * Error codes: 70130803Smarcel */ 71130803Smarcel 72130803Smarcel/** 73130803Smarcel * The =openpam_free_data function is a cleanup function suitable for 74130803Smarcel * passing to =pam_set_data. 75130803Smarcel * It simply releases the data by passing its =data argument to =free. 76130803Smarcel */ 77130803Smarcel