mosquitto_pub: Close file on file too large.

This wasn't a problem because this error caused the program to
exit, so there was no real resource leak.

Coverity Scan 1430457.
pull/1769/head
Roger A. Light 5 years ago
parent cadcde52a4
commit e272f8fbca

@ -100,6 +100,7 @@ int load_file(const char *filename)
fseek(fptr, 0, SEEK_END);
flen = ftell(fptr);
if(flen > MQTT_MAX_PAYLOAD){
fclose(fptr);
err_printf(&cfg, "Error: File must be less than %u bytes.\n\n", MQTT_MAX_PAYLOAD);
free(cfg.message);
return 1;

Loading…
Cancel
Save