]> sourceware.org Git - systemtap.git/commitdiff
coverity fixes
authorFrank Ch. Eigler <fche@redhat.com>
Fri, 20 Oct 2017 02:22:57 +0000 (22:22 -0400)
committerFrank Ch. Eigler <fche@redhat.com>
Fri, 20 Oct 2017 14:04:03 +0000 (10:04 -0400)
One pthread_create() RC check, one extra-initialized variable.

loc2stap.cxx
stap-serverd.cxx

index 6fd7807fe03e6ce5a8da6db81df9e7dabd8586ae..a79fcd35688eff305737a45f239cf9a142344773 100644 (file)
@@ -796,7 +796,7 @@ location_context::frame_location()
       // the DW_AT_frame_base attribute expression's value first.
       const Dwarf_Op *fb_ops;
       Dwarf_Op *fb_expr;
-      size_t fb_len;
+      size_t fb_len = 0;
 
       if (this->fb_attr == NULL)
        {
index 7cf76c6174b9bbc26dc25d450a8dc2d444464d35..b8f70114c8e22050ce7d542769a2874c643283aa 100644 (file)
@@ -2431,10 +2431,12 @@ accept_connections (PRFileDesc *listenSocket, CERTCertificate *cert)
       t_arg->addr = addr;
 
       /* Handle the conncection */
+      int thread_rc = -1;
       if (max_threads > 0)
         /* Create the worker thread and handle the connection. */
-        pthread_create(&tid, NULL, handle_connection, t_arg);
-      else
+        thread_rc = pthread_create(&tid, NULL, handle_connection, t_arg);
+
+      if (thread_rc != 0)
         /* Since max_threads == 0, don't spawn a new thread,
          * just handle in the current thread. */
         handle_connection(t_arg);
This page took 0.032241 seconds and 5 git commands to generate.