nitlanguage
/
nit.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
(from parent 1:
68da42c
)
Merge: lib/socket: Bugfix
author
Jean Privat
<jean@pryen.org>
Wed, 9 Apr 2014 18:08:07 +0000
(14:08 -0400)
committer
Jean Privat
<jean@pryen.org>
Wed, 9 Apr 2014 18:08:07 +0000
(14:08 -0400)
Bug introduced in pull request #377, in the read function of FFSocket, a free is called on a static variable, which provokes a warning and probably bugs at runtime.
Pull-Request: #389
lib/socket/socket_c.nit
patch
|
blob
|
history
diff --git
a/lib/socket/socket_c.nit
b/lib/socket/socket_c.nit
index
11bda16
..
1d56bcb
100644
(file)
--- a/
lib/socket/socket_c.nit
+++ b/
lib/socket/socket_c.nit
@@
-124,13
+124,11
@@
extern FFSocket `{ S_DESCRIPTOR* `}
static char c[1024];
int n = read(*recv, c, 1024);
if(n < 0) {
- free(c);
return NativeString_to_s_with_length("",0);
}
char* ret = malloc(n + 1);
memcpy(ret, c, n);
ret[n] = '\0';
- free(c);
return NativeString_to_s_with_length(ret, n);
`}