Fix minor issues revealed by static analysis.

This commit is contained in:
Grant Paul 2016-09-02 22:59:40 -07:00
parent a07f339945
commit e7b519503c
3 changed files with 2 additions and 3 deletions

View File

@ -120,7 +120,6 @@ POSSIBILITY OF SUCH DAMAGE.
## osxbom
Initial code
Author: Joseph Coffland
Date: October, 2011
@ -136,7 +135,6 @@ This program is in the public domain.
## ThemeEngine
Copyright (c) 2014, Alex Zielenski
All rights reserved.

View File

@ -350,6 +350,7 @@ bom_variable_iterate(struct bom_context *context, bom_variable_iterator iterator
strncpy(var_name, var->name, var->length);
var_name[var->length] = 0;
if (!iterator(context, var_name, ntohl(var->index), ctx)) {
free(var_name);
break;
}
free(var_name);

View File

@ -291,7 +291,6 @@ Decode(struct car_rendition_value *value)
} else if (value->pixel_format == car_rendition_value_pixel_format_jpeg) {
format = Rendition::Data::Format::JPEG;
} else {
format = Rendition::Data::Format::Data;
fprintf(stderr, "error: unsupported pixel format %.4s\n", (char const *)&value->pixel_format);
return ext::nullopt;
}
@ -632,6 +631,7 @@ write() const
memcpy(output_bytes, info_slices, info_slices_size);
output_bytes += info_slices_size;
free(info_slices);
memcpy(output_bytes, &info_metrics, sizeof(struct car_rendition_info_metrics));
output_bytes += sizeof(struct car_rendition_info_metrics);