aboutsummaryrefslogtreecommitdiffstats
path: root/res/res_speech.c
diff options
context:
space:
mode:
authortilghman <tilghman@f38db490-d61c-443f-a65b-d21fe96a405b>2007-06-06 21:20:11 +0000
committertilghman <tilghman@f38db490-d61c-443f-a65b-d21fe96a405b>2007-06-06 21:20:11 +0000
commiteb5d461ed4688cafadc76bebf329a2fae454dc12 (patch)
tree5503cb153c9de46c07e3a0a521cc996926ed375b /res/res_speech.c
parent125558c76fd4870a9133e4974cce6410c89a3593 (diff)
Issue 9869 - replace malloc and memset with ast_calloc, and other coding guidelines changes
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@67864 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'res/res_speech.c')
-rw-r--r--res/res_speech.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/res/res_speech.c b/res/res_speech.c
index 960c7f42c..67dce81cf 100644
--- a/res/res_speech.c
+++ b/res/res_speech.c
@@ -105,16 +105,16 @@ int ast_speech_results_free(struct ast_speech_result *result)
prev_result = current_result;
/* Deallocate what we can */
if (current_result->text != NULL) {
- free(current_result->text);
+ ast_free(current_result->text);
current_result->text = NULL;
}
if (current_result->grammar != NULL) {
- free(current_result->grammar);
+ ast_free(current_result->grammar);
current_result->grammar = NULL;
}
/* Move on and then free ourselves */
current_result = current_result->next;
- free(prev_result);
+ ast_free(prev_result);
prev_result = NULL;
}
@@ -187,7 +187,7 @@ struct ast_speech *ast_speech_new(char *engine_name, int format)
/* Pass ourselves to the engine so they can set us up some more and if they error out then do not create a structure */
if (engine->create(new_speech)) {
ast_mutex_destroy(&new_speech->lock);
- free(new_speech);
+ ast_free(new_speech);
new_speech = NULL;
}
@@ -211,10 +211,10 @@ int ast_speech_destroy(struct ast_speech *speech)
/* If a processing sound is set - free the memory used by it */
if (speech->processing_sound)
- free(speech->processing_sound);
+ ast_free(speech->processing_sound);
/* Aloha we are done */
- free(speech);
+ ast_free(speech);
return res;
}