Skip to content

Commit

Permalink
Merge pull request #5065 from AnnaRomanov/d435i_win_mem_leak
Browse files Browse the repository at this point in the history
Fix memory leak in hid sensor
  • Loading branch information
dorodnic committed Oct 17, 2019
2 parents 3e1a3ca + 9142463 commit 7a9934f
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/mf/mf-hid.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -207,6 +207,7 @@ namespace librealsense

pSensor->GetFriendlyName(&fName);
d.sensor.name = CW2A(fName);
SysFreeString(fName); // free string after it was copied to sensor data

d.fo.pixels = &data;
d.fo.metadata = &meta_data;
Expand Down
1 change: 1 addition & 0 deletions src/mf/mf-hid.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ namespace librealsense
}

_name = CW2A(fName);
SysFreeString(fName);
};

const std::string& get_sensor_name() const { return _name; }
Expand Down

0 comments on commit 7a9934f

Please sign in to comment.