ltfs icon indicating copy to clipboard operation
ltfs copied to clipboard

Fix: strdup memory check

Open XV02 opened this issue 6 months ago • 1 comments

Summary of changes

This pull request includes following changes or fixes.

  • Added checks for strdup
  • Changed logic of delim strategy to avoid repeated code

Description

This change adds checks for memory allocations done by strdup which previously could lead to unexpected Segmentation faults when the malloc failed and returned null. Also updated the log of one of the uses of strdup to avoid repeated code and stepping up maintainability.

Type of change

Please delete items that are not relevant.

  • Bug fix (non-breaking change which fixes an issue)

Checklist:

  • [x] My code follows the style guidelines of this project
  • [x] I have performed a self-review of my own code
  • [x] I have commented my code, particularly in hard-to-understand areas
  • [x] I have made corresponding changes to the documentation
  • [x] My changes generate no new warnings
  • [x] I have confirmed my fix is effective or that my feature works

XV02 avatar May 26 '25 20:05 XV02

Hi @vandelvan thanks for the reminder, I need to remove the ones checked already, only a couple where left for review, I will update it and come back with the full code checked and ready.

XV02 avatar May 26 '25 21:05 XV02