diff options
author | Dimitri Staessens <dimitri.staessens@intec.ugent.be> | 2016-03-03 17:29:28 +0100 |
---|---|---|
committer | Dimitri Staessens <dimitri.staessens@intec.ugent.be> | 2016-03-03 17:29:28 +0100 |
commit | 0a58878e6c499e0757a11c842cc1d0ac6ffb4ab8 (patch) | |
tree | a2a3d316c2d27eac93e64e60e934cab281d4ac4d /src/irmd/main.c | |
parent | 71c93ca569034b1346dc625b6b22ecab83d5bcce (diff) | |
parent | 6746face5a53d48853cb7f1ad0acc587920183b7 (diff) | |
download | ouroboros-0a58878e6c499e0757a11c842cc1d0ac6ffb4ab8.tar.gz ouroboros-0a58878e6c499e0757a11c842cc1d0ac6ffb4ab8.zip |
Merge branch 'be' of bitbucket.org:ouroboros-rina/ouroboros into be-common
Diffstat (limited to 'src/irmd/main.c')
-rw-r--r-- | src/irmd/main.c | 11 |
1 files changed, 2 insertions, 9 deletions
diff --git a/src/irmd/main.c b/src/irmd/main.c index 73533ef0..0c69de2f 100644 --- a/src/irmd/main.c +++ b/src/irmd/main.c @@ -78,18 +78,12 @@ static void unreg_ipcp(rina_name_t * name, int main() { int sockfd; - uint8_t * buf; + uint8_t buf[IRM_MSG_BUF_SIZE]; sockfd = server_socket_open(IRM_SOCK_PATH); if (sockfd < 0) return -1; - buf = malloc(sizeof(*buf) * IRM_MSG_BUF_SIZE); - if (buf == NULL) { - LOG_ERR("Cannot allocate memory"); - return -ENOMEM; - } - while (true) { int cli_sockfd; struct irm_msg * msg; @@ -140,12 +134,11 @@ int main() LOG_ERR("Don't know that message code"); break; } + free(msg); } close(cli_sockfd); } - free(buf); - return 0; } |