happyfish100 / fastdfs

FastDFS is an open source high performance distributed file system (DFS). It's major functions include: file storing, file syncing and file accessing, and design for high capacity and load balance. Wechat/Weixin public account (Chinese Language): fastdfs
GNU General Public License v3.0
8.97k stars 1.98k forks source link

fix: fix realloc mistakes to avoid memory leaks #631

Closed Yang1032 closed 1 year ago

Yang1032 commented 1 year ago

There are some issues with the use of realloc, where the pointer was nulled but not freed upon failure. This change fixes issues by ensuring that the pointer is freed when realloc fails, preventing potential memory leaks.