Private
Public Access
2
0

imraa.c: General imraa cleanup after static analysis

Signed-off-by: Longwei Su <lsu@ics.com>
Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
This commit is contained in:
Longwei Su
2016-03-22 14:22:16 +00:00
committed by Brendan Le Foll
parent 5cfddd6bcc
commit 30322f8ac5
2 changed files with 55 additions and 33 deletions

View File

@@ -1009,7 +1009,10 @@ mraa_add_from_lockfile(const char* imraa_lock_file) {
fseek(flock, 0, SEEK_SET);
buffer = (char*) calloc(fsize, sizeof(char));
if (buffer != NULL) {
fread(buffer, sizeof(char), fsize, flock);
int result = fread(buffer, sizeof(char), fsize, flock);
if (result != fsize) {
printf("imraa lockfile reading error");
}
}
json_object* jobj_lock = json_tokener_parse(buffer);
@@ -1043,6 +1046,7 @@ mraa_add_from_lockfile(const char* imraa_lock_file) {
}
json_object_put(jobj_lock);
free(buffer);
fclose(flock);
return subplat_num;
}
#endif