Skip to content

Commit c9465ad

Browse files
out_azure_kusto: addressed review comments
Signed-off-by: Tanmaya Panda <[email protected]>
1 parent ef0ac5a commit c9465ad

File tree

2 files changed

+3
-22
lines changed

2 files changed

+3
-22
lines changed

plugins/out_azure_blob/azure_blob.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -473,6 +473,7 @@ static int send_blob(struct flb_config *config,
473473
/* Allocate memory for the random string dynamically */
474474
generated_random_string = flb_malloc(ctx->blob_uri_length + 1);
475475
if (!generated_random_string) {
476+
flb_errno();
476477
flb_plg_error(ctx->ins, "cannot allocate memory for random string");
477478
flb_sds_destroy(ref_name);
478479
return FLB_RETRY;
@@ -1201,7 +1202,6 @@ static void cb_azure_blob_ingest(struct flb_config *config, void *data) {
12011202

12021203
/* Log entry point and container information */
12031204
flb_plg_debug(ctx->ins, "Running upload timer callback (cb_azure_blob_ingest)..");
1204-
flb_plg_debug(ctx->ins, "inside ctx : container name is %s", ctx->container_name);
12051205

12061206
/* Initialize jitter for retry mechanism */
12071207
srand(time(NULL));

plugins/out_azure_blob/azure_blob_store.c

Lines changed: 2 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,6 @@ int azure_blob_store_buffer_put(struct flb_azure_blob *ctx, struct azure_blob_fi
122122
flb_sds_t name;
123123
struct flb_fstore_file *fsf;
124124
size_t space_remaining;
125-
// flb_sds_t path_sds;
126125

127126
if (ctx->store_dir_limit_size > 0 && ctx->current_buffer_size + bytes >= ctx->store_dir_limit_size) {
128127
flb_plg_error(ctx->ins, "Buffer is full: current_buffer_size=%zu, new_data=%zu, store_dir_limit_size=%zu bytes",
@@ -154,6 +153,7 @@ int azure_blob_store_buffer_put(struct flb_azure_blob *ctx, struct azure_blob_fi
154153
if (ret == -1) {
155154
flb_plg_warn(ctx->ins, "Deleting buffer file because metadata could not be written");
156155
flb_fstore_file_delete(ctx->fs, fsf);
156+
flb_sds_destroy(name);
157157
return -1;
158158
}
159159

@@ -163,6 +163,7 @@ int azure_blob_store_buffer_put(struct flb_azure_blob *ctx, struct azure_blob_fi
163163
flb_errno();
164164
flb_plg_warn(ctx->ins, "Deleting buffer file because azure_blob context creation failed");
165165
flb_fstore_file_delete(ctx->fs, fsf);
166+
flb_sds_destroy(name);
166167
return -1;
167168
}
168169
azure_blob_file->fsf = fsf;
@@ -334,7 +335,6 @@ int azure_blob_store_exit(struct flb_azure_blob *ctx)
334335
fsf = mk_list_entry(f_head, struct flb_fstore_file, _head);
335336
if (fsf->data != NULL) {
336337
azure_blob_file = fsf->data;
337-
//flb_sds_destroy(azure_blob_file->file_path);
338338
flb_free(azure_blob_file);
339339
}
340340
}
@@ -400,25 +400,6 @@ int azure_blob_store_file_inactive(struct flb_azure_blob *ctx, struct azure_blob
400400
return ret;
401401
}
402402

403-
void azure_blob_file_cleanup(struct azure_blob_file *file)
404-
{
405-
if (file == NULL) {
406-
return;
407-
}
408-
409-
// Free the file path if it was dynamically allocated
410-
/*if (file->file_path != NULL) {
411-
flb_sds_destroy(file->file_path);
412-
file->file_path = NULL;
413-
}*/
414-
415-
// If there are other dynamically allocated members, free them here
416-
// For now, we only free file_path as per the given struct
417-
418-
// Free the azure_blob_file itself
419-
//flb_free(file);
420-
}
421-
422403
int azure_blob_store_file_cleanup(struct flb_azure_blob *ctx, struct azure_blob_file *azure_blob_file)
423404
{
424405
struct flb_fstore_file *fsf;

0 commit comments

Comments
 (0)