Commit Diff


commit - 32a8078ad8afc1c27b732329f01b1be07b81c09889ec7f01c0c1da85bc60a057
commit + 6369375bb261d4e55ce449a7d2b3e8ff113da8e71c7bf36f496041ed2324565f
blob - 5e0e85282e6a8332cbd11b77459ec3799544c7b900c5b8e54331d09b045fa02a
blob + ea147120e7283a0480f21f3e58234398d33cfca0cf77b2dbc466f1c1f526c810
--- gotd/parse.y	
+++ gotd/parse.y	
@@ -232,9 +232,12 @@ timeout		: NUMBER {
 		;
 
 main		: LISTEN ON STRING {
-			if (!got_path_is_absolute($3))
+			if (!got_path_is_absolute($3)) {
 				yyerror("bad unix socket path \"%s\": "
 				    "must be an absolute path", $3);
+				free($3);
+				YYERROR;
+			}
 
 			if (gotd_proc_id == GOTD_PROC_GOTD) {
 				if (strlcpy(gotd->unix_socket_path, $3,
@@ -702,8 +705,10 @@ repoopts1	: PATH STRING {
 
 					if (strlcpy(new_repo->path, $2,
 					    sizeof(new_repo->path)) >=
-					    sizeof(new_repo->path))
+					    sizeof(new_repo->path)) {
 						yyerror("path too long");
+						YYERROR;
+					}
 				}
 			}
 			free($2);