Skip to content
  • Carlos O'Donell (Red Hat)'s avatar
    We should not free the nrhs if it was not set. · 6788224a
    Carlos O'Donell (Red Hat) authored
    
    
    Fix compilation with gcc 11 and glibc 2.33.
    
    It is possible to have a switch statement value that causes an
    invalid free. So set nrhs to a value that can be distinguished if
    we are in the fall-through case.
    
    expr.c: In function ‘expr_clone’:
    expr.c:240:33: error: ‘nrhs’ may be used uninitialized in this function [-Werror=maybe-uninitialized]
      240 |                                 free(nrhs);
          |                                 ^~~~~~~~~~
    cc1: all warnings being treated as errors
    
    This is downstream Fedora patch: ltrace-0.7.91-rh1799619.patch
    The downstream patch can be removed.
    
    Signed-off-by: default avatarCarlos O'Donell <carlos@redhat.com>
    6788224a