Skip to content

Commit 4c5c4eb

Browse files
authored
Merge pull request #187 from janisozaur/pvs-studio-fixes-gib
Correctly allocate a Gib
2 parents e66d35c + 72065d6 commit 4c5c4eb

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -168,3 +168,7 @@ This repository includes launch configurations to automatically build and debug
168168
These launch configurations are accessible via the [Run and Debug](https://code.visualstudio.com/docs/editor/debugging#_run-and-debug-view) view, and provide profiles to build and run the game in Release mode or any of the [3 Debug modes](https://github.com/cortex-command-community/Cortex-Command-Community-Project-Source/wiki/Meson-build-options).
169169

170170
All configurations will run pre-launch tasks to build the game using the supported backend before launching.
171+
172+
## SAST Tools
173+
174+
[PVS-Studio](https://pvs-studio.com/en/pvs-studio/?utm_source=website&utm_medium=github&utm_campaign=open_source) - static analyzer for C, C++, C#, and Java code.

Source/Activities/GibEditor.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -632,7 +632,7 @@ void GibEditor::StuffEditedGibs(MOSRotating* pEditedObject) {
632632
// Take each proxy object and stuff it into a Gib instance which then gets stuffed into the object to be saved
633633
std::list<MovableObject*>* pProxyGibList = m_pEditorGUI->GetPlacedGibs();
634634
for (std::list<MovableObject*>::iterator gItr = pProxyGibList->begin(); gItr != pProxyGibList->end(); ++gItr) {
635-
Gib* newGib;
635+
Gib* newGib = new Gib();
636636
// Only set the refernce instance directly from the isntanceman. OWNERSHIP IS NOT TRANSFERRED!
637637
newGib->m_GibParticle = dynamic_cast<const MovableObject*>(g_PresetMan.GetEntityPreset((*gItr)->GetClassName(), (*gItr)->GetPresetName(), m_ModuleSpaceID));
638638
if (newGib->m_GibParticle) {

0 commit comments

Comments
 (0)