Fix: Make sure we have all the metadata streams before adding new traces
[babeltrace.git] / lib / bin-info.c
index 42c426807f4b0f20b30c9686b094adb05e7afed3..65f9051fb00efe087c24c1fe9f66696cf081ebd1 100644 (file)
@@ -329,12 +329,12 @@ int is_valid_debug_file(char *path, uint32_t crc)
        uint32_t _crc = 0;
 
        if (!path) {
-               goto end;
+               goto end_noclose;
        }
 
        fd = open(path, O_RDONLY);
        if (fd < 0) {
-               goto end;
+               goto end_noclose;
        }
 
        ret = crc32(fd, &_crc);
@@ -347,6 +347,7 @@ int is_valid_debug_file(char *path, uint32_t crc)
 
 end:
        close(fd);
+end_noclose:
        return ret;
 }
 
@@ -830,11 +831,13 @@ int bin_info_lookup_cu_function_name(struct bt_dwarf_cu *cu, uint64_t addr,
 
                ret = dwarf_lowpc(die->dwarf_die, &low_addr);
                if (ret) {
+                       free(die_name);
                        goto error;
                }
 
                ret = bin_info_append_offset_str(die_name, low_addr, addr,
                                                func_name);
+               free(die_name);
                if (ret) {
                        goto error;
                }
@@ -1034,7 +1037,7 @@ int bin_info_child_die_has_address(struct bt_dwarf_die *die, uint64_t addr, bool
                                goto error;
                        }
 
-                       if (contains) {
+                       if (_contains) {
                                goto end;
                        }
                }
This page took 0.023727 seconds and 4 git commands to generate.