CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 6 of 6

Threaded View

  1. #1
    Join Date
    Oct 2010
    Posts
    46

    [RESOLVED] Help with memory leak

    Hi. I'm having problems with my code. First of all i think i should mention i'm doing some sockets prgraming (non-MFC). Everything is working fine, however,
    Code:
    _CrtDumpMemoryLeaks()
    is telling me that there's a memory leak. I did some research and i found out that it appears after these lines of code:
    Code:
    //char buff[257]
    //wchar_t dataBuff[257]
    //std::wstring *data - this is a valid pointer passed to function
    
    received += singleRecv;
    buff[singleRecv] = '\0';
    mbstowcs_s(&converted, dataBuff, 257, buff, singleRecv);
    *data += dataBuff;
    Text with wich memory leak appears to be is 9 symbols. These are pretty much all variables wich gets in touch with it but it seems that none of these variables' address matches memory leak address. I think this might be silly mistake or something i'm overlooking but i can't find it. Hopefully you can Didn't felt a need to burden this post with whole function code, but feel free tell me if you need it.

    Thanks in advance,
    Fire_
    Last edited by fire_; April 23rd, 2012 at 08:55 AM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured