/* PSPPIRE - a graphical user interface for PSPP.
- Copyright (C) 2007 Free Software Foundation
+ Copyright (C) 2007, 2009, 2011 Free Software Foundation
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
#include <gl/gettext.h>
+#include "xalloc.h"
/* Create a GtkLabel and pack it into BOX.
The label is created using part of the string at S, and the directives
if ( 0 != printf_parse (fmt, &d, &a) )
return NULL;
- widgets = calloc (sizeof (*widgets), d.count);
+ widgets = xcalloc (sizeof (*widgets), d.count);
va_start (ap, fmt);
for (i = 0 ; i < d.count ; ++i )
{
}
va_end (ap);
- g_free (a.arg);
+ if (a.arg != a.direct_alloc_arg)
+ free (a.arg);
output = g_string_sized_new (strlen (fmt));
}
free (widgets);
- free (d.dir);
+ if (d.dir != d.direct_alloc_dir)
+ free (d.dir);
if (*s)
g_string_append_len (output, s, -1);
if ( 0 != printf_parse (fmt, &d, &a) )
return NULL;
- g_free (a.arg);
+ if (a.arg != a.direct_alloc_arg)
+ free (a.arg);
va_start (ap, fmt);
g_free (widgets);
- free (d.dir);
+ if (d.dir != d.direct_alloc_dir)
+ free (d.dir);
return hbox;
}