aboutsummaryrefslogtreecommitdiff
path: root/gdb/dtrace-probe.c
diff options
context:
space:
mode:
authorPaul Pluzhnikov <ppluzhnikov@google.com>2019-06-17 10:49:15 -0700
committerPaul Pluzhnikov <ppluzhnikov@google.com>2019-06-17 10:49:15 -0700
commitba9777bef059df0926ad5dd6813d5785cb652ccf (patch)
tree1f11f4d759abe53da5230a7c34345d1512fcc0f5 /gdb/dtrace-probe.c
parent6e1c90b7f5d60aedc547dd84873d1c9291eefcdc (diff)
downloadgdb-ba9777bef059df0926ad5dd6813d5785cb652ccf.zip
gdb-ba9777bef059df0926ad5dd6813d5785cb652ccf.tar.gz
gdb-ba9777bef059df0926ad5dd6813d5785cb652ccf.tar.bz2
PR gdb/24364: Don't call dtrace_process_dof with NULL dof.
Diffstat (limited to 'gdb/dtrace-probe.c')
-rw-r--r--gdb/dtrace-probe.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/gdb/dtrace-probe.c b/gdb/dtrace-probe.c
index 5297378..2a2eae1 100644
--- a/gdb/dtrace-probe.c
+++ b/gdb/dtrace-probe.c
@@ -856,13 +856,14 @@ dtrace_static_probe_ops::get_probes
/* Read the contents of the DOF section and then process it to
extract the information of any probe defined into it. */
- if (!bfd_malloc_and_get_section (abfd, sect, &dof))
+ if (bfd_malloc_and_get_section (abfd, sect, &dof) && dof != NULL)
+ dtrace_process_dof (sect, objfile, probesp,
+ (struct dtrace_dof_hdr *) dof);
+ else
complaint (_("could not obtain the contents of"
"section '%s' in objfile `%s'."),
sect->name, abfd->filename);
-
- dtrace_process_dof (sect, objfile, probesp,
- (struct dtrace_dof_hdr *) dof);
+
xfree (dof);
}
}