We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent d833638 commit a4c80fbCopy full SHA for a4c80fb
1 file changed
src/emc/usr_intf/sockets.c
@@ -276,9 +276,12 @@ char* sockGetError(void)
276
277
/* append the message text after the error code and ensure a terminating
278
character ends the string */
279
+ // The 'tmp' buffer is allocated by FormatMessage().
280
+ // cppcheck-suppress nullPointer
281
strncpy(retString + strlen(retString), tmp,
282
sizeof(retString) - strlen(retString) - 1);
283
retString[sizeof(retString) - 1] = '\0';
284
+ LocalFree(tmp);
285
286
return retString;
287
#endif
0 commit comments