Ignore:
Timestamp:
Dec 19, 2014, 6:43:54 PM (5 years ago)
Author:
ldelgass
Message:

Fix leak in sendDataToClient method (when USE_THREADS is enabled)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • nanovis/trunk/FlowCmd.cpp

    r4353 r4880  
    11391139#endif
    11401140    TRACE("Enter: %s", cmd);
    1141     FILE *f;
    1142     f = popen(cmd, "r");
     1141    FILE *f = popen(cmd, "r");
    11431142    if (f == NULL) {
    11441143        Tcl_AppendResult(interp, "can't run ffmpeg: ",
     
    11491148    size_t total = 0;
    11501149    for (;;) {
    1151         ssize_t numRead;
    11521150        char buffer[BUFSIZ];
    11531151       
    1154         numRead = fread(buffer, sizeof(char), BUFSIZ, f);
     1152        ssize_t numRead = fread(buffer, sizeof(char), BUFSIZ, f);
    11551153        total += numRead;
    11561154        if (numRead == 0) {             // EOF
     
    11801178    sprintf(cmd,"nv>image -type movie -token \"%s\" -bytes %lu\n",
    11811179            token, total);
    1182     // Memory is freed by this call
     1180    // Memory for data payload is freed by this call
    11831181    nv::sendDataToClient(cmd, data, total);
    11841182    return TCL_OK;
Note: See TracChangeset for help on using the changeset viewer.