From 9d219cd358a655a2d4e56e7c5931bde7ff456016 Mon Sep 17 00:00:00 2001 From: Jacek Jendrzej Date: Mon, 5 Nov 2012 16:48:41 +0100 Subject: [PATCH] src/driver/streamts.cpp: use new instead of malloc Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/4e3791be7231fa524fb27b734d37a40296d000e3 Author: Jacek Jendrzej Date: 2012-11-05 (Mon, 05 Nov 2012) ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- src/driver/streamts.cpp | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/driver/streamts.cpp b/src/driver/streamts.cpp index ec2633bc0..afeebd388 100644 --- a/src/driver/streamts.cpp +++ b/src/driver/streamts.cpp @@ -259,11 +259,10 @@ void * streamts_live_thread(void *data) char cbuf[512]; char *bp; int fd = (int) data; - FILE * fp; unsigned char demuxfd_count = 0; printf("Starting LIVE STREAM thread, fd %d\n", fd); - fp = fdopen(fd, "r+"); + FILE * fp = fdopen(fd, "r+"); if(fp == NULL) { perror("fdopen"); return 0; @@ -323,9 +322,9 @@ void * streamts_live_thread(void *data) pids[demuxfd_count++] = channel->getAudioChannel(i)->pid; } - buf = (unsigned char *) malloc(IN_SIZE); + buf = new unsigned char [IN_SIZE]; if (buf == NULL) { - perror("malloc"); + perror("NEW"); return 0; } @@ -353,7 +352,7 @@ void * streamts_live_thread(void *data) CCamManager::getInstance()->Stop(CZapit::getInstance()->GetCurrentChannelID(), CCamManager::STREAM); delete dmx; - free(buf); + delete []buf; close(fd); return 0; }