Fix uninitialized variable warnings in remote.c
authorUlrich Weigand <ulrich.weigand@de.ibm.com>
Tue, 1 Dec 2015 16:49:27 +0000 (17:49 +0100)
committerUlrich Weigand <ulrich.weigand@de.ibm.com>
Tue, 1 Dec 2015 16:49:27 +0000 (17:49 +0100)
Fix a couple of places where a struct thread_item was added to a
vector while the item.name field was uninitialized.

gdb/
* remote.c (remote_newthread_step): Initialize item.name.
(remote_get_threads_with_qthreadinfo): Likewise.

gdb/ChangeLog
gdb/remote.c

index 0d2d207b44363debd3bae05d5778518641f69da6..49ba2bc811252fa5160ec4bb51926e13eae243e1 100644 (file)
@@ -1,3 +1,8 @@
+2015-12-01  Ulrich Weigand  <uweigand@de.ibm.com>
+
+       * remote.c (remote_newthread_step): Initialize item.name.
+       (remote_get_threads_with_qthreadinfo): Likewise.
+
 2015-11-30  Pedro Alves  <palves@redhat.com>
 
        PR 14618
index 9d44ce1d7be368cf026b4a72d4cff3c51b609c1f..c60f173632fa5a49e5ca2e3b6f655e90d0b6ac18 100644 (file)
@@ -2914,6 +2914,7 @@ remote_newthread_step (threadref *ref, void *data)
 
   item.ptid = ptid_build (pid, threadref_to_int (ref), 0);
   item.core = -1;
+  item.name = NULL;
   item.extra = NULL;
 
   VEC_safe_push (thread_item_t, context->items, &item);
@@ -3079,6 +3080,7 @@ remote_get_threads_with_qthreadinfo (struct target_ops *ops,
 
                  item.ptid = read_ptid (bufp, &bufp);
                  item.core = -1;
+                 item.name = NULL;
                  item.extra = NULL;
 
                  VEC_safe_push (thread_item_t, context->items, &item);