Commits (1)
  • Robert Sprowson's avatar
    Fix memory leak on error · cbd35b68
    Robert Sprowson authored
    Don't leak pchBuffer on error.
    Found by cppcheck static analysis.
    Tagged as DualSerial-0_25-4_8_2_16-1 since DualSerial itself is unchanged.
    cbd35b68
...@@ -86,6 +86,7 @@ int main(void) ...@@ -86,6 +86,7 @@ int main(void)
if (iInputStream==0 || iOutputStream==0) if (iInputStream==0 || iOutputStream==0)
{ {
printf("Error: cannot open serial streams.\n"); printf("Error: cannot open serial streams.\n");
free(pchBuffer);
return (0); return (0);
} }
......