Skip to content
  • Dan McGee's avatar
    Refactor download payload reset and free · e0acf2f1
    Dan McGee authored
    
    
    This was done to squash a memory leak in the sync database download
    code. When we downloaded a database and then reused the payload struct,
    we could find ourselves calling get_fullpath() for the signatures and
    overwriting non-freed values we had left over from the database
    download.
    
    Refactor the payload_free function into a payload_reset function that we
    can call that does NOT free the payload itself, so we can reuse payload
    structs. This also allows us to move the payload to the stack in some
    call paths, relieving us of the need to alloc space.
    
    Signed-off-by: default avatarDan McGee <dan@archlinux.org>
    e0acf2f1