summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlan D. Brunelle <alan.brunelle@hp.com>2008-11-11 13:40:10 -0500
committerAlan D. Brunelle <alan.brunelle@hp.com>2008-11-11 13:40:10 -0500
commitf3db34733e7c8a46e9e26305e424a3ecd49ac06d (patch)
tree9ce8aee3f9e88d56c9113ecc33e1a87c8520cdd7
parente47ada103e028a691d296d09d0bc673a3af6a3dc (diff)
downloadblktrace-f3db34733e7c8a46e9e26305e424a3ecd49ac06d.tar.gz
blktrace-f3db34733e7c8a46e9e26305e424a3ecd49ac06d.tar.bz2
Fixed segfault in aqd.c : need to check for NULL (not requested)
-rw-r--r--btt/aqd.c22
1 files changed, 13 insertions, 9 deletions
diff --git a/btt/aqd.c b/btt/aqd.c
index 775fca6..6dc3a7a 100644
--- a/btt/aqd.c
+++ b/btt/aqd.c
@@ -65,19 +65,23 @@ void aqd_clean(void)
void aqd_issue(void *info, double ts)
{
- struct aqd_info *ap = info;
+ if (info) {
+ struct aqd_info *ap = info;
- fprintf(ap->fp, "%lf %d\n%lf %d\n", ts, ap->na, ts, ap->na + 1);
-
- ap->na += 1;
+ fprintf(ap->fp, "%lf %d\n%lf %d\n", ts, ap->na, ts, ap->na + 1);
+ ap->na += 1;
+ }
}
void aqd_complete(void *info, double ts)
{
- struct aqd_info *ap = info;
-
- if (ap->na > 0) {
- fprintf(ap->fp, "%lf %d\n%lf %d\n", ts, ap->na, ts, ap->na - 1);
- ap->na -= 1;
+ if (info) {
+ struct aqd_info *ap = info;
+
+ if (ap->na > 0) {
+ fprintf(ap->fp, "%lf %d\n%lf %d\n",
+ ts, ap->na, ts, ap->na - 1);
+ ap->na -= 1;
+ }
}
}