Explorar o código

Fix memory leak in decode_link_specifiers().

This patch fixes a memory leak in decode_link_specifiers() where the
hs_spec variable might leak if the default label is taken in the
switch/case expression.

See: Coverity CID 1437437.
Alexander Færøy %!s(int64=7) %!d(string=hai) anos
pai
achega
3d80c086be
Modificáronse 1 ficheiros con 1 adicións e 0 borrados
  1. 1 0
      src/or/hs_descriptor.c

+ 1 - 0
src/or/hs_descriptor.c

@@ -864,6 +864,7 @@ decode_link_specifiers(const char *encoded)
              sizeof(hs_spec->u.legacy_id));
       break;
     default:
+      tor_free(hs_spec);
       goto err;
     }