• Colin Ian King's avatar
    cifs: fix double free error on share and prefix · c6a80e1f
    Colin Ian King authored
    Currently if the call dfs_cache_get_tgt_share fails we cannot
    fully guarantee that share and prefix are set to NULL and the
    next iteration of the loop can end up potentially double freeing
    these pointers. Since the semantics of dfs_cache_get_tgt_share
    are ambiguous for failure cases with the setting of share and
    prefix (currently now and the possibly the future), it seems
    prudent to set the pointers to NULL when the objects are
    free'd to avoid any double frees.
    
    Addresses-Coverity: ("Double free")
    Fixes: 96296c946a2a ("cifs: handle RESP_GET_DFS_REFERRAL.PathConsumed in reconnect")
    Signed-off-by: default avatarColin Ian King <colin.king@canonical.com>
    Signed-off-by: default avatarSteve French <stfrench@microsoft.com>
    Reviewed-by: default avatarPaulo Alcantara (SUSE) <pc@cjr.nz>
    c6a80e1f
connect.c 147 KB