X-Git-Url: https://review.openocd.org/gitweb?p=openocd.git;a=blobdiff_plain;f=src%2Fhelper%2Fcommand.c;h=d93020e990055665d3f0909a5d0f766c929ede3f;hp=2737a7b23f7d26f2ce43a9d37a6c37bdb185d126;hb=bf5f21e39a6c04c3845dc61becc90d8602546290;hpb=332c8d78d8007e810380d4d0d13a4d47b8fb4d52 diff --git a/src/helper/command.c b/src/helper/command.c index 2737a7b23f..d93020e990 100644 --- a/src/helper/command.c +++ b/src/helper/command.c @@ -117,6 +117,10 @@ static int script_command(Jim_Interp *interp, int argc, Jim_Obj *const *argv) words[i] = strdup(w); if (words[i] == NULL) { + int j; + for (j = 0; j < i; j++) + free(words[j]); + free(words); return JIM_ERR; } }