make destroy_pval able to handle a NULL value

(the warning should be removed);
define a 'elements_block' rule to simplify some other rules
removing duplicated code - runtests seems happy with this.



git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@23613 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
Luigi Rizzo
2006-04-30 12:30:08 +00:00
parent ce05a548c3
commit f4b05f86cc
3 changed files with 642 additions and 640 deletions

View File

@@ -3554,6 +3554,11 @@ STD_MOD(MOD_1 | NO_USECOUNT, reload, NULL, NULL);
void destroy_pval_item(pval *item)
{
if (item == NULL) {
ast_log(LOG_WARNING, "null item\n");
return;
}
if (item->filename)
free(item->filename);