[PR #1463] fix: Prevent segmentation fault at Simple generic Stack #2066

Closed
opened 2026-01-29 15:28:17 +00:00 by claunia · 0 comments
Owner

Original Pull Request: https://github.com/TheAlgorithms/C/pull/1463

State: closed
Merged: No


Description of Change

  • Prevent segmentation fault error at stack.c grow function
    • After malloc, there is an iteration without any check if malloc returned null

References

Checklist

  • Added description of change
  • PR title follows semantic commit guidelines
  • Search previous suggestions before making a new one, as yours may be a duplicate.
  • I acknowledge that all my contributions will be made under the project's license.

Notes: Used realloc instead of malloc

**Original Pull Request:** https://github.com/TheAlgorithms/C/pull/1463 **State:** closed **Merged:** No --- #### Description of Change - Prevent segmentation fault error at stack.c grow function - After malloc, there is an iteration without any check if malloc returned null #### References #### Checklist - [x] Added description of change - [x] PR title follows semantic [commit guidelines](https://github.com/TheAlgorithms/C/blob/master/CONTRIBUTING.md#Commit-Guidelines) - [x] Search previous suggestions before making a new one, as yours may be a duplicate. - [x] I acknowledge that all my contributions will be made under the project's license. Notes: Used realloc instead of malloc
claunia added the pull-request label 2026-01-29 15:28:17 +00:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/C#2066