libctf: fix uninitialized variable in symbol serialization error handling
authorNick Alcock <nick.alcock@oracle.com>
Thu, 28 Jan 2021 15:00:11 +0000 (15:00 +0000)
committerNick Alcock <nick.alcock@oracle.com>
Thu, 4 Feb 2021 16:01:53 +0000 (16:01 +0000)
We declare a variable to hold errors at two scopes, and then initialize
the inner one and jump to a scope where only the outer one is in scope.

The consequences are minor: only the version of the error message
printed in the debugging stream is impacted.

libctf/ChangeLog
2021-01-27  Nick Alcock  <nick.alcock@oracle.com>

* ctf-create.c (ctf_serialize): Fix shadowing.

libctf/ChangeLog
libctf/ctf-create.c

index 10178bca86d2cd14ab84da7833e819fdac961bad..c700297abc6813051f78fc1b1ee4676cc599f35c 100644 (file)
@@ -1,3 +1,7 @@
+2021-01-27  Nick Alcock  <nick.alcock@oracle.com>
+
+       * ctf-create.c (ctf_serialize): Fix shadowing.
+
 2021-01-27  Nick Alcock  <nick.alcock@oracle.com>
 
        * ctf-create.c (ctf_add_encoded): Add check for non-empty name.
index cf12557b5d54618b571048cd3388164dc5e5e3d8..c01ab7a10e2169d7e8ee67bb96f2dc275dc87d95 100644 (file)
@@ -907,7 +907,6 @@ ctf_serialize (ctf_dict_t *fp)
       ctf_next_t *i = NULL;
       void *symname;
       const char **walk;
-      int err;
 
       if (filter_syms)
        {