summaryrefslogtreecommitdiff
path: root/src/wispr.c
diff options
context:
space:
mode:
authorJukka Rissanen <jukka.rissanen@linux.intel.com>2012-05-02 13:13:06 +0300
committerPatrik Flykt <patrik.flykt@linux.intel.com>2012-05-02 15:38:30 +0300
commit68cb4891010f9fbf682d6a089f3b37b435e55264 (patch)
tree926261fac54f94365887d17b2ba7b9b1adf898e2 /src/wispr.c
parentaa9676ae82da7932413a73000d6d3930a455946c (diff)
downloadconnman-68cb4891010f9fbf682d6a089f3b37b435e55264.tar.gz
connman-68cb4891010f9fbf682d6a089f3b37b435e55264.tar.bz2
connman-68cb4891010f9fbf682d6a089f3b37b435e55264.zip
wispr: Use g_strdup() instead of strdup()
Valgrind reports following error if strdup() is used here: ==12572== Invalid read of size 4 ==12572== at 0x429113B: ??? (in /lib/libc-2.11.90.so) ==12572== by 0x80A8154: wispr_route_request (wispr.c:471) ==12572== by 0x805CA4F: resolv_result (gweb.c:449) ==12572== by 0x805DD4B: sort_and_return_results (gresolv.c:494) ==12572== by 0x805E285: received_udp_data (gresolv.c:705) ==12572== by 0x40AD8E6: ??? (in /lib/libglib-2.0.so.0.2800.6) ==12572== by 0x4078AFA: g_main_context_dispatch (in /lib/libglib-2.0.so.0.2800.6) ==12572== by 0x407911E: ??? (in /lib/libglib-2.0.so.0.2800.6) ==12572== by 0x40796BC: g_main_loop_run (in /lib/libglib-2.0.so.0.2800.6) ==12572== by 0x807400F: main (main.c:508) ==12572== Address 0x55f406c is 20 bytes inside a block of size 22 alloc'd ==12572== at 0x4029AE9: malloc (vg_replace_malloc.c:236) ==12572== by 0x40B1D6C: g_malloc (in /lib/libglib-2.0.so.0.2800.6) ==12572== by 0x40B4C25: g_strdup (in /lib/libglib-2.0.so.0.2800.6) ==12572== by 0x805CA23: resolv_result (gweb.c:1222) ==12572== by 0x805DD4B: sort_and_return_results (gresolv.c:494) ==12572== by 0x805E285: received_udp_data (gresolv.c:705) ==12572== by 0x40AD8E6: ??? (in /lib/libglib-2.0.so.0.2800.6) ==12572== by 0x4078AFA: g_main_context_dispatch (in /lib/libglib-2.0.so.0.2800.6) ==12572== by 0x407911E: ??? (in /lib/libglib-2.0.so.0.2800.6) ==12572== by 0x40796BC: g_main_loop_run (in /lib/libglib-2.0.so.0.2800.6) ==12572== by 0x807400F: main (main.c:508) ==12572== If g_strdup() is used then no error is printed. This error does not make much sense but anyway use g_strdup() like in other parts of this file.
Diffstat (limited to 'src/wispr.c')
-rw-r--r--src/wispr.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/wispr.c b/src/wispr.c
index 034ccede..f44a21ae 100644
--- a/src/wispr.c
+++ b/src/wispr.c
@@ -468,7 +468,7 @@ static gboolean wispr_route_request(const char *address, int ai_family,
return FALSE;
}
- route->address = strdup(address);
+ route->address = g_strdup(address);
route->if_index = if_index;
wp_context->route_list = g_slist_prepend(wp_context->route_list, route);