mirror of
https://github.com/asterisk/asterisk.git
synced 2025-09-05 20:20:07 +00:00
Fix a couple potential minor memory leaks. load_moh_classes() could return
without destroying the loaded configuration. git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.2@75107 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
@@ -1052,7 +1052,7 @@ static int load_moh_classes(int reload)
|
|||||||
class = moh_class_malloc();
|
class = moh_class_malloc();
|
||||||
if (!class) {
|
if (!class) {
|
||||||
ast_log(LOG_WARNING, "Out of memory!\n");
|
ast_log(LOG_WARNING, "Out of memory!\n");
|
||||||
return numclasses;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
ast_copy_string(class->name, var->name, sizeof(class->name));
|
ast_copy_string(class->name, var->name, sizeof(class->name));
|
||||||
@@ -1080,7 +1080,7 @@ static int load_moh_classes(int reload)
|
|||||||
class = moh_class_malloc();
|
class = moh_class_malloc();
|
||||||
if (!class) {
|
if (!class) {
|
||||||
ast_log(LOG_WARNING, "Out of memory!\n");
|
ast_log(LOG_WARNING, "Out of memory!\n");
|
||||||
return numclasses;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
ast_copy_string(class->name, var->name, sizeof(class->name));
|
ast_copy_string(class->name, var->name, sizeof(class->name));
|
||||||
|
Reference in New Issue
Block a user