/* get config file from .. or from . */
#define CONFIG_FILE_NAME "dumpasn1.cfg"
-static const char *CONFIG_FILE1 = "../"CONFIG_FILE_NAME;
+static const char *CONFIG_FILE1 = "../" CONFIG_FILE_NAME;
static const char *CONFIG_FILE2 = CONFIG_FILE_NAME;
/* or from here via getenv */
#define CONFIG_FILE_ENV "LOCAL_BUILD_DIR"
{
int rtn;
int fd;
- unsigned char *buf;
+ unsigned char *buf = NULL;
struct stat sb;
size_t size;
rtn = ENOMEM;
goto errOut;
}
- rtn = (int)lseek(fd, 0, SEEK_SET);
- if(rtn < 0) {
- goto errOut;
- }
rtn = (int)read(fd, buf, (size_t)size);
if(rtn != (int)size) {
+ free(buf);
if(rtn >= 0) {
printf("readFile: short read\n");
}