Skip to content

Replace malloc and realloc with corresponding glibc function#2316

Merged
DaveDavenport merged 1 commit into
davatorium:nextfrom
jakobwsmnn:malloc-gmalloc
Jul 9, 2026
Merged

Replace malloc and realloc with corresponding glibc function#2316
DaveDavenport merged 1 commit into
davatorium:nextfrom
jakobwsmnn:malloc-gmalloc

Conversation

@jakobwsmnn

Copy link
Copy Markdown
Contributor

Description

The entire codebase uses g_malloc and g_realloc, but rofi.c and ssh.c do not.
g_malloc terminates the program on allocation failure. malloc does not.

Is there a particular reason why malloc is used here instead of g_malloc?
If malloc should be used here, a NULL check should be added.

Solution:

Replace malloc/realloc with g_malloc/g_realloc in rofi.c and malloc with g_malloc0 in ssh.c.

@DaveDavenport

Copy link
Copy Markdown
Collaborator

No particular reason, mostly habit.

I've tried to avoid it, must have missed these.

@DaveDavenport
DaveDavenport merged commit a6afacb into davatorium:next Jul 9, 2026
5 checks passed
@DaveDavenport

Copy link
Copy Markdown
Collaborator

Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants