utils.c revision 240120
160484Sobrien/*
291041Sobrien * Automated Testing Framework (atf)
391041Sobrien *
460484Sobrien * Copyright (c) 2010 The NetBSD Foundation, Inc.
560484Sobrien * All rights reserved.
660484Sobrien *
760484Sobrien * Redistribution and use in source and binary forms, with or without
860484Sobrien * modification, are permitted provided that the following conditions
960484Sobrien * are met:
1060484Sobrien * 1. Redistributions of source code must retain the above copyright
1160484Sobrien *    notice, this list of conditions and the following disclaimer.
1260484Sobrien * 2. Redistributions in binary form must reproduce the above copyright
1360484Sobrien *    notice, this list of conditions and the following disclaimer in the
1460484Sobrien *    documentation and/or other materials provided with the distribution.
1560484Sobrien *
1660484Sobrien * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND
1760484Sobrien * CONTRIBUTORS ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
1860484Sobrien * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
1960484Sobrien * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
2060484Sobrien * IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS BE LIABLE FOR ANY
2160484Sobrien * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
2260484Sobrien * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
2360484Sobrien * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
2460484Sobrien * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
2560484Sobrien * IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
2660484Sobrien * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
2760484Sobrien * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
2860484Sobrien */
2960484Sobrien
3060484Sobrien#include <stdlib.h>
3160484Sobrien
3260484Sobrien#include "atf-c/utils.h"
3360484Sobrien
3460484Sobrienvoid
3560484Sobrienatf_utils_free_charpp(char **argv)
3660484Sobrien{
3760484Sobrien    char **ptr;
3860484Sobrien
3960484Sobrien    for (ptr = argv; *ptr != NULL; ptr++)
4060484Sobrien        free(*ptr);
4160484Sobrien
4260484Sobrien    free(argv);
4360484Sobrien}
44130561Sobrien