2
0
Эх сурвалжийг харах

core: proper test when initializing _ksr_shutdown_phase shm pointer

Daniel-Constantin Mierla 5 жил өмнө
parent
commit
27b2ddf926
1 өөрчлөгдсөн 2 нэмэгдсэн , 2 устгасан
  1. 2 2
      src/core/sr_module.c

+ 2 - 2
src/core/sr_module.c

@@ -110,11 +110,11 @@ unsigned int set_modinit_delay(unsigned int v)
 }
 
 /* shut down phase for instance - kept in shared memory */
-static int *_ksr_shutdown_phase = 0;
+static int *_ksr_shutdown_phase = NULL;
 
 int ksr_shutdown_phase_init(void)
 {
-	if(_ksr_shutdown_phase) {
+	if(_ksr_shutdown_phase == NULL) {
 		_ksr_shutdown_phase = (int*)shm_malloc(sizeof(int));
 	}
 	return 0;