Skip to content

Commit 613ab59

Browse files
committed
Try to fix another memory leak.
1 parent edf31c8 commit 613ab59

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

src/gpuarray_buffer_cuda.c

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1223,6 +1223,8 @@ static int compile(cuda_context *ctx, strb *src, strb* bin, strb *log) {
12231223

12241224
GA_CHECK(make_bin(ctx, &ptx, bin, log));
12251225

1226+
strb_clear(&ptx);
1227+
12261228
if (ctx->disk_cache) {
12271229
pk = calloc(sizeof(disk_key), 1);
12281230
if (pk == NULL) {
@@ -1234,23 +1236,23 @@ static int compile(cuda_context *ctx, strb *src, strb* bin, strb *log) {
12341236
memcpy(pk, &k, DISK_KEY_MM);
12351237
strb_appendb(&pk->src, src);
12361238
if (strb_error(&pk->src)) {
1237-
error_sys(ctx->err, "strb_appendb");
1239+
error_sys(ctx->err, "strb_appendb");
12381240
fprintf(stderr, "Error adding kernel to disk cache %s\n",
12391241
ctx->err->msg);
12401242
disk_free((cache_key_t)pk);
12411243
return GA_NO_ERROR;
12421244
}
12431245
cbin = strb_alloc(bin->l);
12441246
if (cbin == NULL) {
1245-
error_sys(ctx->err, "strb_alloc");
1247+
error_sys(ctx->err, "strb_alloc");
12461248
fprintf(stderr, "Error adding kernel to disk cache: %s\n",
12471249
ctx->err->msg);
12481250
disk_free((cache_key_t)pk);
12491251
return GA_NO_ERROR;
12501252
}
12511253
strb_appendb(cbin, bin);
12521254
if (strb_error(cbin)) {
1253-
error_sys(ctx->err, "strb_appendb");
1255+
error_sys(ctx->err, "strb_appendb");
12541256
fprintf(stderr, "Error adding kernel to disk cache %s\n",
12551257
ctx->err->msg);
12561258
disk_free((cache_key_t)pk);

0 commit comments

Comments
 (0)