More coverity

This commit is contained in:
jvoisin 2015-01-25 14:35:30 +01:00
parent 8dd161efc2
commit 9681c6fcf7
4 changed files with 10 additions and 3 deletions

View File

@ -103,8 +103,10 @@ static int buf_fprintf(void *stream, const char *format, ...) {
return R_FALSE;
va_start (ap, format);
tmp = malloc (strlen (format)+strlen (buf_global)+2);
if (tmp == NULL)
if (tmp == NULL) {
va_end (ap);
return R_FALSE;
}
sprintf (tmp, "%s%s", buf_global, format);
vsprintf (buf_global, tmp, ap);
va_end (ap);

View File

@ -1167,6 +1167,8 @@ if (
if (r_buf_read_at (bin->b, strtab_section->sh_offset,
(ut8*)strtab, strtab_section->sh_size) == -1) {
eprintf ("Warning: read (syms strtab)\n");
free (ret);
free (strtab);
return NULL;
}

View File

@ -564,9 +564,9 @@ static RList* classes (RBinFile *arch) {
dprintf ("# anotations_offset = %08x;\n", entry.anotations_offset);
dprintf ("# class_data_offset = %08x;\n", entry.class_data_offset);
dprintf ("# static_values_offset = %08x;\n\n", entry.static_values_offset);
free (name);
}
}
free (name);
return ret;
}

View File

@ -1343,7 +1343,10 @@ reaccept:
r_mem_copyendian ((ut8*)&i, buf, 4, !LE);
if (i>0&&i<RMT_MAX) {
ptr = (ut8 *) malloc (i+7);
if (!ptr) return R_FALSE;
if (!ptr) {
r_socket_close (c);
return R_FALSE;
}
ptr[5]='!';
r_socket_read_block (c, ptr+6, i);
ptr[6+i]='\0';