  With the expansion of the software scale and complexity of smart grid
systems, the detection of smart grid software defects has become a research
hotspot. Because of the large scale of the existing smart grid software code,
the efficiency and accuracy of the existing smart grid defect detection
algorithms are not high. We propose an intelligent memory leak detection scheme
based on defect modes MLD in smart grid. Based on the analysis of existing
memory leak defect modes, we summarize memory operation behaviors (allocation,
release and transfer) and present a state machine model. We employ a fuzzy
matching algorithm based on regular expression to determine the memory
operation behaviors and then analyze the change in the state machine to assess
the vulnerability in the source code. To improve the efficiency of detection
and solve the problem of repeated detection at the function call point, we
propose a function summary method for memory operation behaviors. The
experimental results demonstrate that the method we proposed has high detection
speed and accuracy. The algorithm we proposed can identify the defects of the
smart grid operation software and ensure the safe operation of the grid.
