Menu

fix for bad delete in iperf2 options parsing

nick black
2017-07-03
2017-07-03
  • nick black

    nick black - 2017-07-03

    In at least version 2.0.9 of iperf2 (taken from current git), there's a mismatched new[]/delete. The delete also needs to be a delete[]. This shows up immediately in valgrind when run with memcheck.

    The fix is pretty simple:

    @@ -586,7 +589,7 @@
    mExtSettings->mBindPort = atoi(results);
    }
    }
    - delete parsedopts;
    + delete[] parsedopts;
    if (mExtSettings->mLocalhost == NULL) {
    mExtSettings->mLocalhost = new char[ strlen( optarg ) + 1 ];
    strcpy( mExtSettings->mLocalhost, optarg );

    If this patch is included, please credit it to Nick Black of Luma, Inc. Thanks!

     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.