mirror of
https://github.com/theoludwig/programming-challenges.git
synced 2025-05-18 12:02:53 +02:00
fix(solutions): memory issues thanks to -fsanitize=address flag with gcc
This commit is contained in:
@ -28,8 +28,10 @@ int* get_dividers_list(int number, int* dividers_length) {
|
||||
|
||||
bool is_prime_number(int number) {
|
||||
int dividers_length;
|
||||
get_dividers_list(number, ÷rs_length);
|
||||
return dividers_length == 2;
|
||||
int* dividers_list = get_dividers_list(number, ÷rs_length);
|
||||
bool result = dividers_length == 2;
|
||||
free(dividers_list);
|
||||
return result;
|
||||
}
|
||||
|
||||
int sum_multiply_numbers(int* numbers, int numbers_length) {
|
||||
|
Reference in New Issue
Block a user