Module: kamailio
Branch: master
Commit: dadd54a46f81ef05478e622a89a3bb739907cade
URL:
https://github.com/kamailio/kamailio/commit/dadd54a46f81ef05478e622a89a3bb7…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com>
Committer: Daniel-Constantin Mierla <miconda(a)gmail.com>
Date: 2017-07-20T09:31:49+02:00
xmpp: close fd in case of write error
---
Modified: src/modules/xmpp/xode_from.c
---
Diff:
https://github.com/kamailio/kamailio/commit/dadd54a46f81ef05478e622a89a3bb7…
Patch:
https://github.com/kamailio/kamailio/commit/dadd54a46f81ef05478e622a89a3bb7…
---
diff --git a/src/modules/xmpp/xode_from.c b/src/modules/xmpp/xode_from.c
index f2d9b54569..8a78f4ba4d 100644
--- a/src/modules/xmpp/xode_from.c
+++ b/src/modules/xmpp/xode_from.c
@@ -225,8 +225,10 @@ int xode_to_file(char *file, xode node)
doc = xode_to_str(node);
i = write(fd,doc,strlen(doc));
- if(i < 0)
+ if(i < 0) {
+ close(fd);
return -1;
+ }
close(fd);
return 1;