diff --git a/modules/objdetect/src/lsvmparser.cpp b/modules/objdetect/src/lsvmparser.cpp
index 34dfae1e2..52c4d825d 100644
--- a/modules/objdetect/src/lsvmparser.cpp
+++ b/modules/objdetect/src/lsvmparser.cpp
@@ -790,7 +790,7 @@ int loadModel(
               float *scoreThreshold){
     int last;
     int max;
-    int *comp;
+    int *comp = NULL;
     int count;
     int i;
     int err;