X-Git-Url: https://gerrit.automotivelinux.org/gerrit/gitweb?a=blobdiff_plain;f=src%2Fafb-export.c;h=a1112d2317033b90e3526951ad56e5bf42127262;hb=81359c788d04cd08ddbee9195267718037040c79;hp=bfd765391ba28c39a685dac5d8f93cd377a141b0;hpb=bc247d4c9e16e548c84466d8975529568e7c395d;p=src%2Fapp-framework-binder.git diff --git a/src/afb-export.c b/src/afb-export.c index bfd76539..a1112d23 100644 --- a/src/afb-export.c +++ b/src/afb-export.c @@ -163,7 +163,7 @@ struct afb_export } export; /* initial name */ - char name[1]; + char name[]; }; /*****************************************************************************/ @@ -1271,7 +1271,7 @@ static struct afb_export *create( return NULL; } lenapi = strlen(apiname); - export = calloc(1, sizeof *export + lenapi + (path == apiname || !path ? 0 : strlen(path))); + export = calloc(1, sizeof *export + 1 + lenapi + (path == apiname || !path ? 0 : 1 + strlen(path))); if (!export) errno = ENOMEM; else {