Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

메모리 누수 해결 #61

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion lib/libscarf/include/std__system.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@

void *std__calloc(size_t count, size_t size);
void *std__allocate(size_t count, size_t size);
void std__dealloc(void **ptr_ptr);
void std__deallocate(void **ptr_ptr);
/*
** < mem.c > */

Expand Down
4 changes: 2 additions & 2 deletions lib/libscarf/src/std__string/dealloc.c
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
*/
void str__delete(t_string *this)
{
std__dealloc((void **)this);
std__deallocate((void **)this);
}

void str__delete__arr(t_string_arr *arr_ptr)
Expand All @@ -31,5 +31,5 @@ void str__delete__arr(t_string_arr *arr_ptr)
i = -1;
while ((*arr_ptr)[++i])
str__delete(&(*arr_ptr)[i]);
std__dealloc((void **)arr_ptr);
std__deallocate((void **)arr_ptr);
}
4 changes: 2 additions & 2 deletions lib/libscarf/src/std__system/alloc.c
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,8 @@ void *std__allocate(size_t count, size_t size)
return (ptr);
}

/** @brief free pointer && set it to NULL */
void std__dealloc(void **ptr_ptr)
/** @brief deallocate pointer to data && set it to NULL */
void std__deallocate(void **ptr_ptr)
{
free(*ptr_ptr);
*ptr_ptr = NULL;
Expand Down
Loading