nitlanguage
/
nit.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
d0058f9
)
lib/socket: Bugfix, tried to free a static variable, this provoked a warning when...
author
Lucas Bajolet
<r4pass@hotmail.com>
Tue, 8 Apr 2014 19:33:10 +0000
(15:33 -0400)
committer
Lucas Bajolet
<r4pass@hotmail.com>
Wed, 9 Apr 2014 15:43:32 +0000
(11:43 -0400)
Signed-off-by: Lucas Bajolet <r4pass@hotmail.com>
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);
`}