Resolve additional cppcheck issues; fix iOS build

This commit is contained in:
Andrew Johnson
2016-12-07 17:51:00 -06:00
parent dba6971e07
commit 63b059c35e
6 changed files with 21 additions and 0 deletions

View File

@@ -243,6 +243,7 @@ int tpn(const char *pname, const char *pvalue)
ptpnInfo = calloc(1, sizeof(tpnInfo));
if (!ptpnInfo) {
printf("calloc failed\n");
free(ppn);
dbChannelDelete(chan);
return -1;
}

View File

@@ -26,6 +26,7 @@
#include "epicsEvent.h"
#include "epicsMutex.h"
#include "epicsStdio.h"
#include "epicsString.h"
#include "epicsThread.h"
#include "epicsTime.h"
#include "errlog.h"

View File

@@ -559,6 +559,7 @@ iocshBody (const char *pathname, const char *commandLine, const char *macros)
if (macros) {
if (macParseDefns(NULL, macros, &defines) < 0) {
free(redirects);
return -1;
}
}
@@ -571,6 +572,7 @@ iocshBody (const char *pathname, const char *commandLine, const char *macros)
if (handle == NULL) {
if (macCreateHandle(&handle, pairs)) {
errlogMessage("iocsh: macCreateHandle failed.");
free(redirects);
return -1;
}

View File

@@ -250,5 +250,12 @@ MAIN(epicsEventTest)
eventWaitTest();
eventWakeupTest();
free(name);
free(id);
epicsRingPointerDelete(pinfo->ring);
epicsMutexDestroy(pinfo->lockRing);
epicsEventDestroy(event);
free(pinfo);
return testDone();
}

View File

@@ -279,5 +279,11 @@ MAIN(epicsMutexTest)
epicsMutexPerformance ();
free(pinfo);
free(arg);
free(name);
free(id);
epicsMutexDestroy(mutex);
return testDone();
}

View File

@@ -115,5 +115,9 @@ MAIN(ringBytesTest)
testOk(n==1, "ring get %d", 1);
check(ring, RINGSIZE);
epicsRingBytesDelete(ring);
epicsEventDestroy(consumerEvent);
free(pinfo);
return testDone();
}