add check.

git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@6842 d0543943-73ff-0310-b7d9-9358b9ac24b2
This commit is contained in:
Michael Jerris 2007-12-17 20:51:32 +00:00
parent 171f02c9ad
commit 06a0c90e50

View File

@ -476,6 +476,7 @@ SWITCH_DECLARE(switch_status_t) switch_dir_open(switch_dir_t **new_dir, const ch
switch_status_t status;
switch_dir_t *dir = malloc(sizeof(*dir));
switch_assert(dir);
memset(dir, 0, sizeof(*dir));
if ((status = apr_dir_open(&(dir->dir_handle), dirname, pool)) == APR_SUCCESS) {
*new_dir = dir;