봐 뭔가 이상한 :그냥 루프, 33 누수
==725== Memcheck, a memory error detector
==725== Copyright (C) 2002-2011, and GNU GPL'd, by Julian Seward et al.
==725== Using Valgrind-3.7.0 and LibVEX; rerun with -h for copyright info
==725== Command: ./a.out hello my friends
==725==
--725-- ./a.out:
--725-- dSYM directory is missing; consider using --dsymutil=yes
./a.out
hello
my
friends
==725==
==725== HEAP SUMMARY:
==725== in use at exit: 6,146 bytes in 33 blocks
==725== total heap usage: 33 allocs, 0 frees, 6,146 bytes allocated
==725==
==725== LEAK SUMMARY:
==725== definitely lost: 0 bytes in 0 blocks
==725== indirectly lost: 0 bytes in 0 blocks
==725== possibly lost: 0 bytes in 0 blocks
==725== still reachable: 6,146 bytes in 33 blocks
==725== suppressed: 0 bytes in 0 blocks
==725== Rerun with --leak-check=full to see details of leaked memory
==725==
==725== For counts of detected and suppressed errors, rerun with: -v
==725== ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 1 from 1)
누군가가 이유를 알고 있으며, 수 경우 여기
$> cat main.c
#include <stdio.h>
int main(int ac, char **av) {
for (int i = 0; i < ac; i++)
printf("%s\n", av[i]);
return 0;
}
$> gcc main.c -std=c99
$> valgrind ./a.out hello my friends
그리고는 결과입니다 어디에서 theses 누수가 온다 나에게 설명해라, 나는 감사 할 것이다!!
좋은 하루 되십시오 :-)
'--leak-check = full'을 사용하여 다시 실행하십시오. 할당은 실제 누수가 아닌 환경 (일회성 시작/초기화 작업)에 의해 수행되는 시스템 작업임을 알 수 있습니다. – Mat
valgrind 출력 메시지에서 제안한 "누출 된 메모리의 세부 정보를 보려면 --leak-check = full로 다시 실행 하시겠습니까?" – bobbymcr