Uploaded image for project: 'StoRM'
  1. StoRM
  2. STOR-1342 Cleanup frontend codebase
  3. STOR-1190

memory leak in get_supported_protocols

XMLWordPrintable

    • Icon: Sub-task Sub-task
    • Resolution: Fixed
    • Icon: Major Major
    • None
    • None
    • frontend
    • Security Level: Public (Visbile by non-authn users.)
    • None

      The address sanitizer report a direct memory leak in the get_supported_protocols function:

      #0 0x7f143be737ae in calloc (/lib64/libasan.so.5+0x10c7ae)
      #1 0x600cb1 in get_supported_protocols /home/centos/storm-frontend.git/src/frontend/storm_util.c:63
      

      At that line there is the allocation of a 10-character string in a loop:

      sup_protocols[i] = calloc(protlen, sizeof(char));

      The overall array of protocol strings is freed in the caller of that function, without first looping and freeing the 10-char arrays.

      It's not clear if the allocated size vs the actual size of the protocols array is available in the caller.

       

            giaco Francesco Giacomini
            giaco Francesco Giacomini
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: