int fail, j;
char *tmp2;
+ tmp = NULL;
pr_info("Reading data for entry %s with offset of %.2f\n",
ow_path, offset);
for (j = 0; j < ret && *tmp2 == ' '; j++)
tmp2++;
- fail = !strncmp(tmp2, "85", 2);
+ if (ret > 0)
+ fail = !strncmp(tmp2, "85", 2);
+ else
+ fail = 1;
/*
* In case of failure, retry with uncached
goto undefined;
}
retries++;
- free(tmp);
+ if (tmp)
+ free(tmp);
}
/* The data from OWNET_read appears to not be NULL terminated */