Skip to content

Commit bf536e0

Browse files
committed
fix: fix free error
1 parent 724a0df commit bf536e0

2 files changed

Lines changed: 8 additions & 8 deletions

File tree

pyWrapper.cpp

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -38,13 +38,13 @@ PYBIND11_EMBEDDED_MODULE(aiges_embed, module) {
3838
if (info.format != py::format_descriptor<unsigned char>::format() || info.ndim != 1) {
3939
throw std::runtime_error("Incompatible buffer format! Please Pass Bytes..");
4040
}
41-
if (r.data == nullptr) {
42-
void *p = malloc(info.shape[0]);
43-
if (p == nullptr) {
44-
throw std::runtime_error("Can't Allocate memory!");
45-
}
46-
r.data = p;
47-
}
41+
// if (r.data == nullptr) {
42+
// void *p = malloc(info.shape[0]);
43+
// if (p == nullptr) {
44+
// throw std::runtime_error("Can't Allocate memory!");
45+
// }
46+
// r.data = p;
47+
// }
4848
r.len = info.shape[0];
4949
r.data = info.ptr;
5050
// memcpy(r.data, info.ptr, info.shape[0]);

wrapper.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -320,7 +320,7 @@ int WrapperAPI wrapperExecFree(const char *usrTag, pDataList *respData) {
320320
pDataList ptr = *respData;
321321
while (ptr != NULL) {
322322
if (ptr->len > 0) {
323-
free(ptr->data);
323+
// free(ptr->data);
324324
ptr->data = NULL;
325325
}
326326
if (strlen(ptr->key) > 0) {

0 commit comments

Comments
 (0)