summaryrefslogtreecommitdiff
path: root/testing
diff options
context:
space:
mode:
authorcharmlesscoin <charmlesscoin@gmail.com>2013-08-04 05:09:12 -0400
committercharmlesscoin <charmlesscoin@gmail.com>2013-08-04 05:09:12 -0400
commitae8367dc3ee5652a9b10e178ac269cd5cba8797a (patch)
treeffd5332d8c35026a9d63101f11da0fd39b6e6996 /testing
parent0b6806d7f74aca0273e41187d73685bd84eedd28 (diff)
whoops, returning a free'd variable is really not what I meant...
Diffstat (limited to 'testing')
-rw-r--r--testing/misc_tools.c1
-rw-r--r--testing/nTox.c8
2 files changed, 6 insertions, 3 deletions
diff --git a/testing/misc_tools.c b/testing/misc_tools.c
index 08f57588..aa546a88 100644
--- a/testing/misc_tools.c
+++ b/testing/misc_tools.c
@@ -37,6 +37,5 @@ unsigned char * hex_string_to_bin(char hex_string[])
37 for(i = 0; i < len; ++i, pos+=2) 37 for(i = 0; i < len; ++i, pos+=2)
38 sscanf(pos,"%2hhx",&val[i]); 38 sscanf(pos,"%2hhx",&val[i]);
39 39
40 free(val);
41 return val; 40 return val;
42} 41}
diff --git a/testing/nTox.c b/testing/nTox.c
index 15e209a9..9a07ecdc 100644
--- a/testing/nTox.c
+++ b/testing/nTox.c
@@ -142,7 +142,9 @@ void line_eval(char *line)
142 for (i = 0; i < 128; i++) 142 for (i = 0; i < 128; i++)
143 temp_id[i] = line[i+prompt_offset]; 143 temp_id[i] = line[i+prompt_offset];
144 144
145 int num = m_addfriend(hex_string_to_bin(temp_id), (uint8_t*)"Install Gentoo", sizeof("Install Gentoo")); 145 unsigned char *bin_string = hex_string_to_bin(temp_id);
146 int num = m_addfriend(bin_string, (uint8_t*)"Install Gentoo", sizeof("Install Gentoo"));
147 free(bin_string);
146 char numstring[100]; 148 char numstring[100];
147 switch (num) { 149 switch (num) {
148 case -1: 150 case -1:
@@ -456,7 +458,9 @@ int main(int argc, char *argv[])
456 else 458 else
457 exit(1); 459 exit(1);
458 460
459 DHT_bootstrap(bootstrap_ip_port, hex_string_to_bin(argv[3])); 461 unsigned char *binary_string = hex_string_to_bin(argv[3]);
462 DHT_bootstrap(bootstrap_ip_port, binary_string);
463 free(binary_string);
460 nodelay(stdscr, TRUE); 464 nodelay(stdscr, TRUE);
461 while(true) { 465 while(true) {
462 if (on == 0 && DHT_isconnected()) { 466 if (on == 0 && DHT_isconnected()) {