summaryrefslogtreecommitdiff
path: root/lib/util.c
blob: 3c9fef61f37658252d4049a309013d178d18378d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
/* Copyright 2012 NORDUnet A/S. All rights reserved.
   See the file COPYING for licensing information.  */

#include <string.h>
#include <radsec/radsec.h>
#include <radsec/radsec-impl.h>
#include "util.h"

char *
rs_strdup (struct rs_context *ctx, const char *s)
{
  char *buf = rs_calloc (ctx, 1, strlen (s) + 1);

  if (buf != NULL)
    return strcpy (buf, s);

  rs_err_ctx_push (ctx, RSE_NOMEM, NULL);
  return NULL;
}