jkorell/iperf

Memory leak

Closed this issue · 7 comments

[src/iperf_api.c:1179]: (error) Memory leak: tcp
[src/locale.c:104]: (error) syntax error
[src/locale.c:334]: (error) Invalid number of character ({) when these macros 
are defined: '__cplusplus'.

Original issue reported on code.google.com by devzone...@gmail.com on 15 Feb 2013 at 12:47

The two errors in locale.c were easily fixed, but I'm surprised that your 
compiler noted them.  It does syntax checking inside #ifdefs that are not 
currently defined?  That seems unusually persnickety.  I like persnickety.

The supposed memory leak remains a mystery.

Original comment by jef.posk...@gmail.com on 16 Feb 2013 at 12:15

[src/units.c:90]: (portability) scanf without field width limits can crash with 
huge input data on libc versions older than 2.13-25. Add a field width 
specifier to fix this problem:
    %i => %3i

Sample program that can crash:

#include <stdio.h>
int main()
{
    int a;
    scanf("%i", &a);
    return 0;
}

To make it crash:
perl -e 'print "5"x2100000' | ./a.out

Original comment by devzone...@gmail.com on 16 Feb 2013 at 12:29

Is this analysis coming from valgrind or something?

Original comment by jdu...@es.net on 16 Feb 2013 at 12:30

@jdu,

Yes cppcheck, http://sourceforge.net/apps/trac/cppcheck/

Original comment by devzone...@gmail.com on 16 Feb 2013 at 12:33

[src/iperf_api.c:1179]: (error) Memory leak: tcp
[src/iperf_api.c:1680]: (debug) inconclusive leak of sp: ; alloc ; use ; if 
return ; return use ; }
[src/iperf_api.c:769]: (debug) uninitialized variables: bailout. can't 
determine if this condition can be false when previous condition is false: 
(Nwrite(test.ctrl_sck,&test.state,1,SOCK_STREAM)<0)
[src/iperf_api.c:1232]: (debug) uninitialized variables: bailout. can't 
determine if this condition can be false when previous condition is false: 
(test.stats_timer)

Original comment by devzone...@gmail.com on 16 Feb 2013 at 12:37

Original comment by bltier...@es.net on 12 Mar 2013 at 10:46

  • Added labels: Milestone-3.0-Release
was not able to replicate
problem may be fixed.

Original comment by bltier...@es.net on 8 May 2013 at 9:33

  • Changed state: WontFix