revert my pass through the tree to remove checks of the result of ast_strdupa
[asterisk/asterisk.git] / apps / app_externalivr.c
index a53a595..1023204 100644 (file)
 /*! \file
  *
  * \brief External IVR application interface
- * 
+ *
+ * \author Kevin P. Fleming <kpfleming@digium.com>
+ *
+ * \note Portions taken from the file-based music-on-hold work
+ * created by Anthony Minessale II in res_musiconhold.c
+ *
  * \ingroup applications
  */
 
@@ -44,6 +49,7 @@ ASTERISK_FILE_VERSION(__FILE__, "$Revision$")
 #include "asterisk/module.h"
 #include "asterisk/linkedlists.h"
 #include "asterisk/app.h"
+#include "asterisk/utils.h"
 
 static const char *tdesc = "External IVR Interface Application";
 
@@ -107,10 +113,8 @@ static void *gen_alloc(struct ast_channel *chan, void *params)
 {
        struct localuser *u = params;
        struct gen_state *state;
-
-       state = calloc(1, sizeof(*state));
-
-       if (!state)
+       
+       if (!(state = ast_calloc(1, sizeof(*state))))
                return NULL;
 
        state->u = u;
@@ -229,10 +233,8 @@ static struct ast_generator gen =
 static struct playlist_entry *make_entry(const char *filename)
 {
        struct playlist_entry *entry;
-
-       entry = calloc(1, sizeof(*entry) + strlen(filename) + 10);
-
-       if (!entry)
+       
+       if (!(entry = ast_calloc(1, sizeof(*entry) + strlen(filename) + 10)))
                return NULL;
 
        strcpy(entry->filename, filename);