Skip to main content
Code Review

Return to Answer

Commonmark migration
Source Link

###Memory leak / useless variable###

Memory leak / useless variable

You have a variable numbers that is a long_list filled with the numbers 1..triangle_number, but you never use this list. Later, when you free the list, you forgot to also free numbers->values.

I would suggest writing a free_long_list() function so that you don't have to remember to free the values field everywhere you free a long_list.

###Memory leak / useless variable###

You have a variable numbers that is a long_list filled with the numbers 1..triangle_number, but you never use this list. Later, when you free the list, you forgot to also free numbers->values.

I would suggest writing a free_long_list() function so that you don't have to remember to free the values field everywhere you free a long_list.

Memory leak / useless variable

You have a variable numbers that is a long_list filled with the numbers 1..triangle_number, but you never use this list. Later, when you free the list, you forgot to also free numbers->values.

I would suggest writing a free_long_list() function so that you don't have to remember to free the values field everywhere you free a long_list.

Source Link
JS1
  • 28.8k
  • 3
  • 41
  • 83

###Memory leak / useless variable###

You have a variable numbers that is a long_list filled with the numbers 1..triangle_number, but you never use this list. Later, when you free the list, you forgot to also free numbers->values.

I would suggest writing a free_long_list() function so that you don't have to remember to free the values field everywhere you free a long_list.

lang-c

AltStyle によって変換されたページ (->オリジナル) /