xref: /onnv-gate/usr/src/lib/gss_mechs/mech_krb5/mech/util_dup.c (revision 0:68f95e015346)
1*0Sstevel@tonic-gate #pragma ident	"%Z%%M%	%I%	%E% SMI"
2*0Sstevel@tonic-gate /*
3*0Sstevel@tonic-gate  * Copyright 1993 by OpenVision Technologies, Inc.
4*0Sstevel@tonic-gate  *
5*0Sstevel@tonic-gate  * Permission to use, copy, modify, distribute, and sell this software
6*0Sstevel@tonic-gate  * and its documentation for any purpose is hereby granted without fee,
7*0Sstevel@tonic-gate  * provided that the above copyright notice appears in all copies and
8*0Sstevel@tonic-gate  * that both that copyright notice and this permission notice appear in
9*0Sstevel@tonic-gate  * supporting documentation, and that the name of OpenVision not be used
10*0Sstevel@tonic-gate  * in advertising or publicity pertaining to distribution of the software
11*0Sstevel@tonic-gate  * without specific, written prior permission. OpenVision makes no
12*0Sstevel@tonic-gate  * representations about the suitability of this software for any
13*0Sstevel@tonic-gate  * purpose.  It is provided "as is" without express or implied warranty.
14*0Sstevel@tonic-gate  *
15*0Sstevel@tonic-gate  * OPENVISION DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
16*0Sstevel@tonic-gate  * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
17*0Sstevel@tonic-gate  * EVENT SHALL OPENVISION BE LIABLE FOR ANY SPECIAL, INDIRECT OR
18*0Sstevel@tonic-gate  * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF
19*0Sstevel@tonic-gate  * USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
20*0Sstevel@tonic-gate  * OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
21*0Sstevel@tonic-gate  * PERFORMANCE OF THIS SOFTWARE.
22*0Sstevel@tonic-gate  */
23*0Sstevel@tonic-gate 
24*0Sstevel@tonic-gate /*
25*0Sstevel@tonic-gate  * $Id: util_dup.c,v 1.7 1996/07/22 20:33:22 marc Exp $
26*0Sstevel@tonic-gate  */
27*0Sstevel@tonic-gate 
28*0Sstevel@tonic-gate #include <gssapiP_generic.h>
29*0Sstevel@tonic-gate #include <string.h>
30*0Sstevel@tonic-gate 
g_strdup(str)31*0Sstevel@tonic-gate char * g_strdup(str)
32*0Sstevel@tonic-gate      char *str;
33*0Sstevel@tonic-gate {
34*0Sstevel@tonic-gate    char *ret;
35*0Sstevel@tonic-gate 
36*0Sstevel@tonic-gate    if ((ret = (char *) xmalloc(strlen(str)+1)) == NULL)
37*0Sstevel@tonic-gate       return(NULL);
38*0Sstevel@tonic-gate 
39*0Sstevel@tonic-gate    strcpy(ret, str);
40*0Sstevel@tonic-gate 
41*0Sstevel@tonic-gate    return(ret);
42*0Sstevel@tonic-gate }
43