blob: 42f3e9908d5cef282583d99911b82d074958547b (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
|
Fixed buffer free problem when sending between threads in the same process.
Upstream-Status: Not Applicable
Signed-off-by: Huimin She <huimin.she@enea.com>
---
diff -rup a/liblinx/linx.c b/liblinx/linx.c
--- a/liblinx/linx.c 2014-04-17 13:40:30.000000000 +0200
+++ b/liblinx/linx.c 2014-07-24 14:22:30.264648751 +0200
@@ -711,7 +711,10 @@ int linx_send(LINX * linx, union LINX_SI
if (ret == 0) {
sig_adm->sndrcv = sndrcv;
}
- adm_free_buf(linx, sig_adm);
+ if (ret != 1) {
+ /* Don't free signals sent back to itself, they are needed later! */
+ adm_free_buf(linx, sig_adm);
+ }
out:
/* Take signal pointer from user. */
*sig = LINX_NIL;
|