diff --git a/src/examples/pmreorder/pmreorder_list.c b/src/examples/pmreorder/pmreorder_list.c
index d4b66708453b56bd6f5c81b5fc37d1c6dafddadc..79f0c0b2c1c825ed2112a722057c9ee48a880175 100644
--- a/src/examples/pmreorder/pmreorder_list.c
+++ b/src/examples/pmreorder/pmreorder_list.c
@@ -1,5 +1,5 @@
/*
- * Copyright 2018, Intel Corporation
+ * Copyright 2019, Intel Corporation
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -95,6 +95,11 @@ list_print(struct list_root *list)
{
FILE *fp;
fp = fopen("pmreorder_list.log", "w+");
+ if (fp == NULL) {
+ perror("fopen pmreorder_list.log");
+ exit(1);
+ }
+
fprintf(fp, "List:\n");
struct list_node *node = NODE_PTR(list, list->head);