Skip to content

Commit 7c07dde

Browse files
committed
replace GIT_ENOMEM with giterr_set_oom()
1 parent 521884d commit 7c07dde

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

sqlite/sqlite.c

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,8 @@ int sqlite_backend__read(void **data_p, size_t *len_p, git_otype *type_p, git_od
8181
*data_p = malloc(*len_p);
8282

8383
if (*data_p == NULL) {
84-
error = GIT_ENOMEM;
84+
giterr_set_oom();
85+
error = GIT_ERROR;
8586
} else {
8687
memcpy(*data_p, sqlite3_column_blob(backend->st_read, 2), *len_p);
8788
error = GIT_OK;
@@ -248,8 +249,10 @@ int git_odb_backend_sqlite(git_odb_backend **backend_out, const char *sqlite_db)
248249
int error;
249250

250251
backend = calloc(1, sizeof(sqlite_backend));
251-
if (backend == NULL)
252-
return GIT_ENOMEM;
252+
if (backend == NULL) {
253+
giterr_set_oom();
254+
return GIT_ERROR;
255+
}
253256

254257
if (sqlite3_open(sqlite_db, &backend->db) != SQLITE_OK)
255258
goto cleanup;

0 commit comments

Comments
 (0)