1 /* ksmalloc.c - Walloc wrapper
2 * Copyright (C) 2009 Free Software Foundation, Inc.
3 *
4 * The origin of this code is GnuPG.
5 *
6 * This file is free software; as a special exception the author gives
7 * unlimited permission to copy and/or distribute it, with or without
8 * modifications, as long as this notice is preserved.
9 *
10 * This file is distributed in the hope that it will be useful, but
11 * WITHOUT ANY WARRANTY, to the extent permitted by law; without even the
12 * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
13 */
14
15 #include <stdlib.h>
16
17 /* A wrapper around malloc because libcompat requires it. */
18 void *
xtrymalloc(size_t n)19 xtrymalloc (size_t n)
20 {
21 return malloc (n);
22 }
23
24
25 /* A wrapper around free becuase we are used to it. */
26 void
xfree(void * p)27 xfree (void *p)
28 {
29 if (p)
30 free (p);
31 }
32
33