Skip to content

Commit 92169bf

Browse files
committed
bug fix: memory leak
1 parent 72e0f54 commit 92169bf

File tree

2 files changed

+3
-0
lines changed

2 files changed

+3
-0
lines changed

examples/llava/llava.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -503,11 +503,13 @@ static bool load_file_to_bytes(const char* path, unsigned char** bytesOut, long
503503
size_t ret = fread(buffer, 1, fileSize, file); // Read the file into the buffer
504504
if (ferror(file)) {
505505
LOG_ERR("read error: %s", strerror(errno));
506+
free(buffer);
506507
fclose(file);
507508
return false;
508509
}
509510
if (ret != (size_t) fileSize) {
510511
LOG_ERR("unexpectedly reached end of file");
512+
free(buffer);
511513
fclose(file);
512514
return false;
513515
}

ggml/src/kompute

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Subproject commit 4565194ed7c32d1d2efa32ceab4d3c6cae006306

0 commit comments

Comments
 (0)