Fix coverity scan 159296, dereference after null check

This commit is contained in:
Roger A. Light
2025-08-10 19:47:06 +01:00
parent 14ce957168
commit b1e78d3915
+1 -1
View File
@@ -286,7 +286,7 @@ BROKER_EXPORT char *mosquitto_strndup(const char *s, size_t n)
str = mosquitto_malloc(size + 1);
if(str){
memcpy(str, s, size);
str[size] = 0;
}
str[size] = 0;
return str;
}