diff options
author | tilghman <tilghman@f38db490-d61c-443f-a65b-d21fe96a405b> | 2007-06-06 21:20:11 +0000 |
---|---|---|
committer | tilghman <tilghman@f38db490-d61c-443f-a65b-d21fe96a405b> | 2007-06-06 21:20:11 +0000 |
commit | eb5d461ed4688cafadc76bebf329a2fae454dc12 (patch) | |
tree | 5503cb153c9de46c07e3a0a521cc996926ed375b /apps/app_osplookup.c | |
parent | 125558c76fd4870a9133e4974cce6410c89a3593 (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 'apps/app_osplookup.c')
-rw-r--r-- | apps/app_osplookup.c | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/apps/app_osplookup.c b/apps/app_osplookup.c index 59e4fb0ed..c7ff964b5 100644 --- a/apps/app_osplookup.c +++ b/apps/app_osplookup.c @@ -328,7 +328,7 @@ static int osp_create_provider( error = OSPPUtilLoadPEMPrivateKey((unsigned char*)p->privatekey, &privatekey); if (error != OSPC_ERR_NO_ERROR) { ast_log(LOG_WARNING, "OSP: Unable to load privatekey '%s', error '%d'\n", p->privatekey, error); - free(p); + ast_free(p); return 0; } @@ -336,9 +336,9 @@ static int osp_create_provider( if (error != OSPC_ERR_NO_ERROR) { ast_log(LOG_WARNING, "OSP: Unable to load localcert '%s', error '%d'\n", p->localcert, error); if (privatekey.PrivateKeyData) { - free(privatekey.PrivateKeyData); + ast_free(privatekey.PrivateKeyData); } - free(p); + ast_free(p); return 0; } @@ -354,16 +354,16 @@ static int osp_create_provider( ast_log(LOG_WARNING, "OSP: Unable to load cacert '%s', error '%d'\n", p->cacerts[i], error); for (j = 0; j < i; j++) { if (cacerts[j].CertData) { - free(cacerts[j].CertData); + ast_free(cacerts[j].CertData); } } if (localcert.CertData) { - free(localcert.CertData); + ast_free(localcert.CertData); } if (privatekey.PrivateKeyData) { - free(privatekey.PrivateKeyData); + ast_free(privatekey.PrivateKeyData); } - free(p); + ast_free(p); return 0; } pcacerts[i] = &cacerts[i]; @@ -394,7 +394,7 @@ static int osp_create_provider( &p->handle); if (error != OSPC_ERR_NO_ERROR) { ast_log(LOG_WARNING, "OSP: Unable to create provider '%s', error '%d'\n", provider, error); - free(p); + ast_free(p); res = -1; } else { if (option_debug) @@ -408,14 +408,14 @@ static int osp_create_provider( for (i = 0; i < p->cacount; i++) { if (cacerts[i].CertData) { - free(cacerts[i].CertData); + ast_free(cacerts[i].CertData); } } if (localcert.CertData) { - free(localcert.CertData); + ast_free(localcert.CertData); } if (privatekey.PrivateKeyData) { - free(privatekey.PrivateKeyData); + ast_free(privatekey.PrivateKeyData); } return res; @@ -2009,7 +2009,7 @@ static int osp_unload(void) while(p) { next = p->next; OSPPProviderDelete(p->handle, 0); - free(p); + ast_free(p); p = next; } ospproviders = NULL; |