194209Sdes/*-
2115619Sdes * Copyright (c) 2002-2003 Networks Associates Technology, Inc.
3228690Sdes * Copyright (c) 2004-2011 Dag-Erling Sm��rgrav
494209Sdes * All rights reserved.
594209Sdes *
694209Sdes * This software was developed for the FreeBSD Project by ThinkSec AS and
799158Sdes * Network Associates Laboratories, the Security Research Division of
899158Sdes * Network Associates, Inc.  under DARPA/SPAWAR contract N66001-01-C-8035
999158Sdes * ("CBOSS"), as part of the DARPA CHATS research program.
1094209Sdes *
1194209Sdes * Redistribution and use in source and binary forms, with or without
1294209Sdes * modification, are permitted provided that the following conditions
1394209Sdes * are met:
1494209Sdes * 1. Redistributions of source code must retain the above copyright
1594209Sdes *    notice, this list of conditions and the following disclaimer.
1694209Sdes * 2. Redistributions in binary form must reproduce the above copyright
1794209Sdes *    notice, this list of conditions and the following disclaimer in the
1894209Sdes *    documentation and/or other materials provided with the distribution.
1994209Sdes * 3. The name of the author may not be used to endorse or promote
2094209Sdes *    products derived from this software without specific prior written
2194209Sdes *    permission.
2294209Sdes *
2394209Sdes * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
2494209Sdes * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
2594209Sdes * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
2694209Sdes * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
2794209Sdes * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
2894209Sdes * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
2994209Sdes * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
3094209Sdes * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
3194209Sdes * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
3294209Sdes * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
3394209Sdes * SUCH DAMAGE.
3494209Sdes *
35255376Sdes * $Id: openpam_free_data.c 648 2013-03-05 17:54:27Z des $
3694209Sdes */
3794209Sdes
38228690Sdes#ifdef HAVE_CONFIG_H
39228690Sdes# include "config.h"
40228690Sdes#endif
41228690Sdes
4294209Sdes#include <stdlib.h>
4394209Sdes#include <string.h>
4494209Sdes
4594209Sdes#include <security/pam_appl.h>
4694209Sdes
4794209Sdes#include "openpam_impl.h"
4894209Sdes
4994209Sdes/*
5094209Sdes * OpenPAM extension
5194209Sdes *
5294209Sdes * Generic cleanup function
5394209Sdes */
5494209Sdes
5594209Sdesvoid
56141098Sdesopenpam_free_data(pam_handle_t *pamh,
57141098Sdes	void *data,
58141098Sdes	int status)
5994209Sdes{
60107937Sdes
61107937Sdes	ENTER();
62107937Sdes	(void)pamh;
63107937Sdes	(void)status;
64115619Sdes	FREE(data);
65107937Sdes	RETURNV();
6694209Sdes}
6794209Sdes
6894209Sdes/*
6994209Sdes * Error codes:
7094209Sdes */
7194209Sdes
7294209Sdes/**
73141098Sdes * The =openpam_free_data function is a cleanup function suitable for
74141098Sdes * passing to =pam_set_data.
75141098Sdes * It simply releases the data by passing its =data argument to =free.
7694209Sdes */
77