mirror of
https://github.com/asterisk/asterisk.git
synced 2025-11-20 08:40:16 +00:00
use ast_calloc instead of calloc, and do a little bit of tweaking on the code formatting
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@15026 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
10
http.c
10
http.c
@@ -297,8 +297,10 @@ static void *http_root(void *data)
|
|||||||
ast_log(LOG_WARNING, "Accept failed: %s\n", strerror(errno));
|
ast_log(LOG_WARNING, "Accept failed: %s\n", strerror(errno));
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
ser = calloc(1, sizeof(*ser));
|
if (!(ser = ast_calloc(1, sizeof(*ser)))) {
|
||||||
if (ser) {
|
close(fd);
|
||||||
|
continue;
|
||||||
|
}
|
||||||
ser->fd = fd;
|
ser->fd = fd;
|
||||||
if ((ser->f = fdopen(ser->fd, "w+"))) {
|
if ((ser->f = fdopen(ser->fd, "w+"))) {
|
||||||
if (ast_pthread_create(&launched, NULL, ast_httpd_helper_thread, ser)) {
|
if (ast_pthread_create(&launched, NULL, ast_httpd_helper_thread, ser)) {
|
||||||
@@ -311,10 +313,6 @@ static void *http_root(void *data)
|
|||||||
close(ser->fd);
|
close(ser->fd);
|
||||||
free(ser);
|
free(ser);
|
||||||
}
|
}
|
||||||
} else {
|
|
||||||
ast_log(LOG_WARNING, "Out of memory!\n");
|
|
||||||
close(fd);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user