summaryrefslogtreecommitdiff
path: root/src/lib/dev.c
diff options
context:
space:
mode:
authordimitri staessens <[email protected]>2016-05-08 16:14:35 +0200
committerdimitri staessens <[email protected]>2016-05-08 16:14:35 +0200
commit7d0fcf6392be6a738d0ba7450b62f8c48062279a (patch)
tree7d098bb422be8597dd2a30a60a08a44a89d5ebf6 /src/lib/dev.c
parenteb9f44379d5316e7f7e9311d7a66d2041eca743a (diff)
downloadouroboros-7d0fcf6392be6a738d0ba7450b62f8c48062279a.tar.gz
ouroboros-7d0fcf6392be6a738d0ba7450b62f8c48062279a.zip
lib/irmd/ipcpd/tools: fixes comments on eb9f443
Diffstat (limited to 'src/lib/dev.c')
-rw-r--r--src/lib/dev.c20
1 files changed, 17 insertions, 3 deletions
diff --git a/src/lib/dev.c b/src/lib/dev.c
index 40bf2dc3..c99e8cdb 100644
--- a/src/lib/dev.c
+++ b/src/lib/dev.c
@@ -249,12 +249,26 @@ int flow_accept(int fd,
return -1;
}
+ *ap_name = strdup(recv_msg->ap_name);
+ if (*ap_name == NULL) {
+ bmp_release(_ap_instance->fds, cfd);
+ irm_msg__free_unpacked(recv_msg, NULL);
+ return -1;
+ }
+
+ if (ae_name != NULL) {
+ *ae_name = strdup(recv_msg->ae_name);
+ if (*ae_name == NULL) {
+ bmp_release(_ap_instance->fds, cfd);
+ irm_msg__free_unpacked(recv_msg, NULL);
+ return -1;
+ }
+ }
+
_ap_instance->flows[cfd].port_id = recv_msg->port_id;
_ap_instance->flows[cfd].oflags = FLOW_O_DEFAULT;
- *ap_name = strdup(recv_msg->ap_name);
- if (ae_name != NULL)
- *ae_name = strdup(recv_msg->ae_name);
+
irm_msg__free_unpacked(recv_msg, NULL);